A Bit of History
There were several things which decided how remstats would work. One of the
major ones was, of course, RRDtool. I wanted to have good
graphs, without having to build them from scratch. I liked the side benefit
that RRDs do not grow, lessening the file-management required.
I've dealt with various monitoring packages with long-running daemons which are
always needing to be restarted, or checked via cron jobs and I decided that
remstats wouldn't have that kind of problem.
Back in the bad old days, you couldn't count on having an SNMP agent available
on every platform, so I decided that remstats wouldn't require SNMP to work.
Now, of course, there is the wonderful
Net-SNMP project to provide a portable
SNMP implementation.
I wanted it to be easily extendable, without having to completely understand
the guts of remstats. This goal has not been met very successfully, though
I hope to improve this in the 2.x releases. However, some folks have managed
to create new collectors, so I guess it wasn't a complete failure.
The Collection Process
The process of data collection in remstats is begun by the run-remstats2
program. (In older versions, run-remstats, a more primitive program,
filled the same niche.) It is started by cron at the minimum collection
interval. It passes through several stages in the order listed in the
run config-file. Some of these stages may have conditions
on them. E.G. the standard stage pagemakers
will only be run if the
remstats configuration has changed.
Each stage is described by a file in the
run-stages config-dir, which lists all the programs
to run. These are all started and run in parallel. When all the programs
(or pipelines) are finished, run-remstats2 moves to the next stage.
The standard stages are:
-
check - checks the configuration to make sure it's good, and as a side-effect
creates any required new/missing RRDs, other files or directories.
-
ping - runs the ping-collector to see which hosts are up, so as to avoid
wasting time on hosts which are down. Hosts which aren't pinged are considered
to be "up" for collection purposes, to deal with un-pingable hosts.
-
collectors - runs all the other collectors in parallel
-
post-collector - runs the error-collector, which collects info on the collectors.
-
monitors - runs the remstats monitors which evaluate the current status of the
monitored systems and issue alerts, if warranted.
-
pagemakers - runs a motley crew of programs to create various kinds of web pages, but
only if the configuration has changed. One of the standard cron jobs will
touch the man configuration directory to force page generation once a day.