ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/ihost-perl/ihost.pl
Revision 1.51
Fri Mar 28 16:30:30 2003 UTC (21 years, 8 months ago) by tdb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.50: +1 -1 lines
FILE REMOVED
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 :-)

Revision 1.50 - (view) (annotate) - [select for diffs]
Tue May 21 16:47:11 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 , to selected 1.22
Added URL to GPL headers.

Revision 1.49 - (view) (annotate) - [select for diffs]
Sat May 18 18:15:56 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.48: +20 -1 lines
Diff to previous 1.48 , to selected 1.22
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 ;)

Revision 1.48 - (view) (annotate) - [select for diffs]
Sat May 11 17:20:07 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.47: +14 -14 lines
Diff to previous 1.47 , to selected 1.22
Now conforms more strictly to the protocol spec. Also uses chomp instead of
chop to strip the \n from server messages - it seems safer.

Revision 1.47 - (view) (annotate) - [select for diffs]
Thu Mar 21 17:57:13 2002 UTC (22 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.46: +7 -1 lines
Diff to previous 1.46 , to selected 1.22
Added key authentication to ihost.

Revision 1.46 - (view) (annotate) - [select for diffs]
Mon Mar 11 13:34:24 2002 UTC (22 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.45: +11 -1 lines
Diff to previous 1.45 , to selected 1.22
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.

Revision 1.45 - (view) (annotate) - [select for diffs]
Tue Dec 18 06:07:00 2001 UTC (22 years, 11 months ago) by tdb
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 , to selected 1.22
A slight tidy up actually broke something. opps.

Revision 1.44 - (view) (annotate) - [select for diffs]
Tue Dec 18 04:07:17 2001 UTC (22 years, 11 months ago) by tdb
Branch: MAIN
Changes since 1.43: +9 -3 lines
Diff to previous 1.43 , to selected 1.22
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.

Revision 1.43 - (view) (annotate) - [select for diffs]
Tue Dec 18 03:51:11 2001 UTC (22 years, 11 months ago) by tdb
Branch: MAIN
Changes since 1.42: +43 -27 lines
Diff to previous 1.42 , to selected 1.22
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 :)

Revision 1.42 - (view) (annotate) - [select for diffs]
Wed Nov 21 10:08:20 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 , to selected 1.22
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>

Revision 1.41 - (view) (annotate) - [select for diffs]
Tue Nov 20 12:47:03 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.40: +6 -2 lines
Diff to previous 1.40 , to selected 1.22
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.

Revision 1.40 - (view) (annotate) - [select for diffs]
Mon Nov 19 22:31:18 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 , to selected 1.22
Some bugs that turned up when using a different version of perl on a
different operating system -- it seemed more verbose.

Revision 1.39 - (view) (annotate) - [select for diffs]
Mon Nov 19 17:43:00 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.38: +4 -1 lines
Diff to previous 1.38 , to selected 1.22
Can't believe I left the sort out! The data must be sorted for the XML
creation code to work properly.

Revision 1.38 - (view) (annotate) - [select for diffs]
Mon Nov 19 15:07:56 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 , to selected 1.22
Opps. Left in some debugging code. Thanks Paul ;)

Revision 1.37 - (view) (annotate) - [select for diffs]
Mon Nov 19 14:15:14 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.36: +18 -12 lines
Diff to previous 1.36 , to selected 1.22
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.

Revision 1.36 - (view) (annotate) - [select for diffs]
Wed Nov 14 16:41:30 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.35: +52 -86 lines
Diff to previous 1.35 , to selected 1.22
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.

Revision 1.35 - (view) (annotate) - [select for diffs]
Wed Nov 14 14:17:12 2001 UTC (23 years ago) by tdb
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 , to selected 1.22
Use the builtin sleep function of perl, at Paul's suggestion.

Revision 1.34 - (view) (annotate) - [select for diffs]
Thu Mar 22 08:53:59 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Changes since 1.33: +8 -3 lines
Diff to previous 1.33 , to selected 1.22
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.

Revision 1.33 - (view) (annotate) - [select for diffs]
Tue Mar 20 12:58:22 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.32: +4 -3 lines
Diff to previous 1.32 , to selected 1.22
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.

Revision 1.32 - (view) (annotate) - [select for diffs]
Fri Mar 16 18:25:59 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.31: +45 -27 lines
Diff to previous 1.31 , to selected 1.22
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.

Revision 1.31 - (view) (annotate) - [select for diffs]
Thu Mar 15 09:46:18 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 , to selected 1.22
Just changed the expression within the connection while loop.

Revision 1.30 - (view) (annotate) - [select for diffs]
Thu Mar 15 09:44:08 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 , to selected 1.22
If we cannot connect to the filter manager, then we shall retry without
closing the socket, as it won't be open to close ;)

Revision 1.29 - (view) (annotate) - [select for diffs]
Wed Mar 14 18:49:00 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 , to selected 1.22
Retry time is now ten minutes (wave of arm)

Revision 1.28 - (view) (annotate) - [select for diffs]
Wed Mar 14 18:48:33 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.27: +129 -97 lines
Diff to previous 1.27 , to selected 1.22
Added retry waits to the configuration process.

Revision 1.27 - (view) (annotate) - [select for diffs]
Wed Mar 14 18:00:16 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.26: +8 -1 lines
Diff to previous 1.26 , to selected 1.22
Added support for reconfiguring upon any type of heartbeat error.

Revision 1.26 - (view) (annotate) - [select for diffs]
Mon Mar 12 23:51:15 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 , to selected 1.22
Changed the path of the PID file... it didn't work so well when the ihost
directory is on a shared file store :)

Revision 1.25 - (view) (annotate) - [select for diffs]
Mon Mar 12 23:20:43 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.24: +21 -1 lines
Diff to previous 1.24 , to selected 1.22
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.

Revision 1.24 - (view) (annotate) - [select for diffs]
Tue Mar 6 08:38:42 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.23: +9 -1 lines
Diff to previous 1.23 , to selected 1.22
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.

Revision 1.23 - (view) (annotate) - [select for diffs]
Thu Mar 1 18:53:42 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.22: +11 -6 lines
Diff to previous 1.22
Changed the way in which the host behaves when the server goes down
mid-heartbeat.  It shouldn't complain; it will just silently withdraw.

Revision 1.22 - (view) (annotate) - [selected]
Thu Mar 1 10:49:27 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.21: +7 -7 lines
Diff to previous 1.21
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.

Revision 1.21 - (view) (annotate) - [select for diffs]
Wed Feb 28 12:25:48 2001 UTC (23 years, 8 months ago) by pjm2
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 , to selected 1.22
Changes made to ensure that the ihost keeps running if it is unable to
open a socket to the filter for performing a heartbeat.

Revision 1.20 - (view) (annotate) - [select for diffs]
Wed Feb 28 10:53:13 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.19: +2 -4 lines
Diff to previous 1.19 , to selected 1.22
Eeeks. Left some debug info in, how very unprofessional of me :)

Revision 1.19 - (view) (annotate) - [select for diffs]
Wed Feb 28 10:52:16 2001 UTC (23 years, 8 months ago) by tdb
Branch: MAIN
Changes since 1.18: +5 -4 lines
Diff to previous 1.18 , to selected 1.22
Although we were getting the FQDN fine, we weren't actually using it :)

Revision 1.18 - (view) (annotate) - [select for diffs]
Tue Feb 27 19:26:51 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.17: +4 -22 lines
Diff to previous 1.17 , to selected 1.22
Removed the now unneccessary code to work out the domain name, etc.
The FQDN is provided by the server.

Revision 1.17 - (view) (annotate) - [select for diffs]
Tue Feb 27 19:14:26 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.16: +10 -2 lines
Diff to previous 1.16 , to selected 1.22
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)

Revision 1.16 - (view) (annotate) - [select for diffs]
Tue Feb 13 12:28:50 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.15: +18 -4 lines
Diff to previous 1.15 , to selected 1.22
It appears /etc/resolv.conf is different on some hosts, so we have to do some
careful checks.

Revision 1.15 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:38:38 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.14: +8 -8 lines
Diff to previous 1.14 , to selected 1.22
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.

Revision 1.14 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:20:07 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 , to selected 1.22
Removed the printing of the entire $disk_info string.

Revision 1.13 - (view) (annotate) - [select for diffs]
Mon Feb 5 17:14:41 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.12: +7 -5 lines
Diff to previous 1.12 , to selected 1.22
Now using the correct names for packet values when obtaining them from the
packet hash.

Revision 1.12 - (view) (annotate) - [select for diffs]
Thu Feb 1 09:24:54 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.11: +37 -3 lines
Diff to previous 1.11 , to selected 1.22
Tidied up the code a little, added explicit returns in the subroutines, a
couple more comments where it was deemed necessary.

Revision 1.11 - (view) (annotate) - [select for diffs]
Thu Feb 1 09:10:52 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.10: +14 -8 lines
Diff to previous 1.10 , to selected 1.22
If the server 'disappears', then the ihost host will carry on running
until it is once again able to deliver TCP heartbeats.

Revision 1.10 - (view) (annotate) - [select for diffs]
Thu Feb 1 03:17:32 2001 UTC (23 years, 9 months ago) by tdb
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 , to selected 1.22
Added sending of the uptime value.

Revision 1.9 - (view) (annotate) - [select for diffs]
Mon Jan 29 16:51:50 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.8: +16 -6 lines
Diff to previous 1.8 , to selected 1.22
Improved the main loop.

Revision 1.8 - (view) (annotate) - [select for diffs]
Mon Jan 29 09:19:16 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.7: +3 -4 lines
Diff to previous 1.7 , to selected 1.22
Fixed problem of domain name not being specified on the first line of the
cat'ed file.

Revision 1.7 - (view) (annotate) - [select for diffs]
Mon Jan 29 09:04:18 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 , to selected 1.22
Fixed a few minor print statements.
Time is now expressed in milliseconds.
The regexp for returning the machine name has been altered.

Revision 1.6 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:47:18 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 , to selected 1.22
Changed the path of perl.

Revision 1.5 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:41:48 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.4: +1 -2 lines
Diff to previous 1.4 , to selected 1.22
Machine hostname is no longer printed out.

Revision 1.4 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:38:50 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 , to selected 1.22
And again...

Revision 1.3 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:32:32 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 , to selected 1.22
Corrected the regexp for hostname again.

Revision 1.2 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:26:11 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 , to selected 1.22
Modified the regular expression to return the hostname.

Revision 1.1 - (view) (annotate) - [select for diffs]
Fri Jan 26 17:09:29 2001 UTC (23 years, 10 months ago) by pjm2
Branch: MAIN
Diff to selected 1.22
The first working version of the solely perl-based host.
Oh my word this is spangly.

Convenience Links

Links to HEAD: (view) (annotate) Links to MAIN: (view) (annotate)

Compare Revisions

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.

  Diffs between and
  Type of Diff should be a