Xymon Mailing List Archive search

Best way to monitor static routing table entries?

list Henrik Størner
Wed, 12 Nov 2008 20:41:02 +0000 (UTC)
Message-Id: <gfff0u$bvf$user-7fe75da36485@xymon.invalid>

In <7FD33A60653949CE943A640CADFAD7DF at FIREBALL> "Gregory Larkin" <user-c353e628177a@xymon.invalid> writes:
I've been using Hobbit for a few years now, and it has always worked really
well for me.  Lately, I've added some more tests to certain servers, and one
thing I'd like to do is detect the presence/absence of some static routes
that are configured on a RHEL4 Linux box.  
I could write a script that greps the output of "netstat -rn" and redirects
it to a file.  Hobbit could monitor the content of the file to make sure it
matches some predefined template, I suppose, but is there a more elegant
way?
The Hobbit client already collects "netstat -rn" as part of the client
data. You can view it via the "Client data" link from any status page,
or you can grab the latest version of it with
 ~hobbit/server/bin/bb 127.0.0.1 "clientlog HOSTNAME section=route"
The netstat-rn output is in the "route" section of the client data.

So it's something fairly obvious to implement as a server-side
extension, like the "hobbitd_rootlogin.pl" example that is
included in the current snapshot. You can grab it from
http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/trunk/hobbitd/hobbitd_rootlogin.pl?revision=5819

Regards,
Henrik