FOGPingHosts Different Subnets (Location Plugin)
-
Unfortunately neither I nor any of my coworkers know PHP. I mainly write in PERL and, while a bit similar to PHP, my code is by no means production quality but I can try to help however I can.
I’ve looked at the FOGPingHosts.service and a quickly thought of trying to create persistence based on time by adding a field into the SQL database that records that last successful ping time.
Touching the database seems a bit overreaching but maybe a field like this already exists. I haven’t had the chance to dump it yet.
Pseudo Code: FogPingHosts.service foreach(Host) { getCurrentTime=CurrentTime; timestampFromSQL= read_sql(timestampSQLField); timeSinceLastSuccessfulPing=getCurrentTime - timestampFromSQL; if(timeSinceLastSuccessfulPing > 180 Seconds) { if(PingHost == successful) { write_sql(timestampSQLField, getCurrentTime); } } }
-
@markbam I’m unsure about how this would resolve the problem as it currently exists.
As I understand it, the problem is that nodes overwrite the status constantly.
While a time check would reduce server stress somewhat, it won’t prevent a certain subnet from ‘getting there’ first and setting an incorrect value. (presuming subnets can’t ping to other subnets, you’d only see what one specific subnet sees, in other words)
So the bug is that storage nodes try and ping all hosts rather than only their own, if I’m getting it right.
-
@Quazz I don’t know that it’s a bug. Yes, i understand this is unexpected behaviour. But Remember the location plugin is a plugin. It’s not a default element of the core of fog. The Core elements attempt to ping all hosts each iteration. (So this is the expected behavior).
That’s not to say we shouldn’t have this in bug reports and we’ll need to add things to the location plugin to distribute the PING Hosts to enable location specific pinging.
This is not currently coded for or thought of so I imagine this will take a while to work out.
-
@markbam I started to implement that but need to push this further down the list. We need to focus on bugs of the core FOG code before that.
Note to myself: I have saved a diff of the current work in my workspace.