Removed some un-used code from CVS. We can always resurrect this later if someone feels they want to work on it. Gone are the old perl ihost which isn't needed now, winhost which is broken and shows no sign of being fixed, and DBReporter. If someone wants to revive them, I'll undelete them :-)
Added URL to GPL headers.
i-scream is now licensed under the GPL. I've added the GPL headers to every source file, and put a full copy of the license in the appropriate places. I think I've covered everything. This is going to be a mad commit ;)
Now conforms more strictly to the protocol spec. Also uses chomp instead of chop to strip the \n from server messages - it seems safer.
Added key authentication to ihost.
If data is given from an ihost plugin with just a tag name, ihost loops forever. An example of such a line is "packet.testlevel.test". This commit fixes this by taking advantage of a kludge :) If the above line was infact "packet.testlevel.test " it would be parsed, albeit creating an empty nest of XML: "<packet><testlevel><test></test></testlevel></packet>". Seeing as this is probably what was intended we just add a space to the end of the offending line and have another go at parsing it :) Also, to further ensure this doesn't happen in future, a catchall statement has been added to drop any lines which don't seem to make sense.
A slight tidy up actually broke something. opps.
Solaris process accounting made me notice the number of times `uname` was being called. It was way over the top, especially as it's unlikely to change during an invocation of ihost :) Before it was run by each plugin every time they were run - in total 50 times a minute :/ Now, it's run once by ihost at startup, and that's it. The value read at startup is passed as a command line argument to each plugin. The plugins can fallback on working out the ostype using `uname` if they don't get given one on the command line.
A bunch of changes to the XML handling. Firstly the packet tag's attributes were being put in wrong, how this got through I don't know! (they were being parsed correctly too, which is kinda odd -- how could both right and wrong attribute tags be parsed?) Secondly the inputted data from plugins is pruned slightly. All blank lines are dropped, along with any lines that don't start with "packet." (this is a requirement I guess) Then the XML code has been made slightly more robust. It wasn't dealing with attributes correctly before, although it went unnoticed. Testing has been a bit more thorough this time, although there could still be bugs. It's a slightly confusing block of recursive code :)
This change has been rolled back. It caused no end of problems for us because our home directories are NFS mounted - so the PID file was the same on a whole block of our hosts... which meant the PID checking really didn't want to work :) Not to mention the problems introduced with the NFS going funny at times ;) <sigh>
Modified location of PID file to user home directory. I was worried that the $HOME environment variable might not be set, so it will fall back to the old location if need be.
Some bugs that turned up when using a different version of perl on a different operating system -- it seemed more verbose.
Can't believe I left the sort out! The data must be sorted for the XML creation code to work properly.
Opps. Left in some debugging code. Thanks Paul ;)
Feature fullfilling some of the following tracker ID on sourceforge: [ #479690 ] make ihost/statgrab more modular This commit adds support for a plugins directory. Any executable file in the directory will be run, making it easier to add more input sources. The next stage will be to move statgrab.pl into the plugins, either in whole or in smaller chunks. Note: is this a possibly security issue? Running all scripts found in a directory might be a bad idea... but assuming the directory is set up ok, I guess it ill be ok.
Feature fullfilling some of the following tracker ID on sourceforge: [ #479690 ] make ihost/statgrab more modular This is my proposal for the new ihost XML processing. It now dynamically creates the XML from the data given to it my statgrab. This allows further expansion in the future with statgrab, possibly making it into smaller sub-scripts to collect data. (ie. cpu.pl disk.pl etc). This takes the largest chunk out of the above feature request. There was some discussion over how this XML processing should be done. In the end I opted for a recursive solution, as we only go a few levels deep. This also means the code is tidy and readable.
Use the builtin sleep function of perl, at Paul's suggestion.
If, during a heartbeat, the host receives an ERROR response from sending the last_modified time of its configuration, the host is expected to reconfigure itself. If the configuration changes many times in a short period of time, many heartbeats may be lost if they bail out as soon as the ERROR response is received. This has now been changed so that a heartbeat is completed in its entirety before the host attempts to reconfigure with the filter manager.
Increased the TCP config wait time between retries to one minute. Fixed sparodic errors with obtaining the I.P. address that caused a host to go all wibbly after a few days.
Lots of changes in the TCP configuration and TCP heartbeats. The aim of this is to make the ihost much more resilient when dealing with broken servers.
Just changed the expression within the connection while loop.
If we cannot connect to the filter manager, then we shall retry without closing the socket, as it won't be open to close ;)
Retry time is now ten minutes (wave of arm)
Added retry waits to the configuration process.
Added support for reconfiguring upon any type of heartbeat error.
Changed the path of the PID file... it didn't work so well when the ihost directory is on a shared file store :)
ihost now writes it's PID to a file, ihost.pid. This is so the ihostchk.sh script can verify if it's still running.
The host now acts sensibly when the server either does not return anything upon sending FILTER or if it returns a filter address that cannot be correctly split into a hostname and pair of ports.
Changed the way in which the host behaves when the server goes down mid-heartbeat. It shouldn't complain; it will just silently withdraw.
Fixed the heartbeat resilience (is that spelt right? ;-) Hosts should no longer die when (or rather, if) the server disappears. Heartbeats will just silently fail instead.
Changes made to ensure that the ihost keeps running if it is unable to open a socket to the filter for performing a heartbeat.
Eeeks. Left some debug info in, how very unprofessional of me :)
Although we were getting the FQDN fine, we weren't actually using it :)
Removed the now unneccessary code to work out the domain name, etc. The FQDN is provided by the server.
Updated to comply with the new FilterManger configuration protocol. Namely, the ihost now also sends "FQDN" to the server to request its fully qualified domain name. This simplifies the task of writing hosts as it no longer means that the host has to work out its own machine name (which is sometimes a non-trivial task on certain platforms)
It appears /etc/resolv.conf is different on some hosts, so we have to do some careful checks.
The building of disk information has been reworked to provide its information as attribute values, as these only occur at most once, thus reducing overall packet size.
Removed the printing of the entire $disk_info string.
Now using the correct names for packet values when obtaining them from the packet hash.
Tidied up the code a little, added explicit returns in the subroutines, a couple more comments where it was deemed necessary.
If the server 'disappears', then the ihost host will carry on running until it is once again able to deliver TCP heartbeats.
Added sending of the uptime value.
Improved the main loop.
Fixed problem of domain name not being specified on the first line of the cat'ed file.
Fixed a few minor print statements. Time is now expressed in milliseconds. The regexp for returning the machine name has been altered.
Changed the path of perl.
Machine hostname is no longer printed out.
And again...
Corrected the regexp for hostname again.
Modified the regular expression to return the hostname.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.