|
Webob Tips and Scripts
Our extensible scripting/process model allows you to monitor
just about anything. On this page we've collected a number of
scripts for
common monitoring tasks ... use them as-is, modify them for your
purposes or just use them as reference when writing your own.
We've tried to provide samples for a variety of languages and
environments. All of the scripts return an exit code of 0 if
things look ok, and non-zero if there's a problem.
Port-level testing
checkport.pl
is a Perl script that takes a host, timeout, protocol and
optional port number on the command line. It opens a server
port and, if appropriate, verifies that the correct
greeting string comes down the wire. Not too inspiring, just a
workhorse that does the job pretty well.
Ping!
Everybody loves ping.
xmlping.pl
takes the output of the system ping command and turns it into an
xml fragment that you can use with XPath matching to be sure that
response times are within acceptable limits. We've had some problems
with the ping that comes with RedHat Linux, so we also wrote
our
own version of ping for Linux that returns XML to stdout.
FTP file drops
checkftp.pl
first checks to be sure that a given ftp site is available. It then
can verify the existence of a particular file, and finally can make
sure that the file is being updated on a schedule you set. This can be
really useful if you expect a feed file from someone else and want
to ensure they're actually sending you data.
WMI and Event Logs (Windows)
wmi-eventlog.vbs helps you monitor Event Logs. This
script is a great reason to learn about XPath matching, because you
can do some really powerful stuff. WMI goes well beyond event
logs and is a great technology for getting all kinds of data
about Windows boxes. Be sure that the Webob process has security
privs to see the servers you're monitoring!
SNMP variables
Monitor all of your SNMP-aware hardware: servers, routers,
switches, you name it.
xmlsnmp.pl
uses the open source
net-snmp package
to generate xml fragments. And as with any xml content, you can
use XPath matching to make sure values are within acceptable
levels.
Fun with shell tools (Linux)
diskspace.sh
spits out free space information in xml; run it locally or on
remote machines with ssh (or rsh, eek). Similarly,
filter the results of top through
topxml.awk
to get cpu and memory utilization per process.
Got a cool Webob script? You'll make our day if you
tell us about it
(and let us know if it's ok to post here). We also provide
consulting services to help
design and implement monitoring systems.
|
|