Xymon Mailing List Archive search

Best way to monitor static routing table entries?

4 messages in this thread

list Gregory Larkin · Wed, 12 Nov 2008 12:00:08 -0500 ·
Hello all,

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?

I checked the BB script archive, and I found the bb-route extension, but
it's either not the right solution or too complicated for what I want to do.

Any suggestions?

Thank you,
Greg

Greg Larkin
Managing Member

SourceHosting.net, LLC
PO Box 1013
Hollis, NH 03049 US
user-c353e628177a@xymon.invalid
http://www.linkedin.com/in/greglarkin
list Paul Root · Wed, 12 Nov 2008 12:48:25 -0600 ·
Just write the script to parse the netstat output, then at the end
decide if it's green or not and send a message to hobbit with the 'bb'
command.  


Paul Root         IM/MNS Infrastructure    
quoted from Gregory Larkin
-----Original Message-----
From: Gregory Larkin [mailto:user-c353e628177a@xymon.invalid] 
Sent: Wednesday, November 12, 2008 11:00 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Best way to monitor static routing table entries?

Hello all,

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?

I checked the BB script archive, and I found the bb-route extension, but
it's either not the right solution or too complicated for what I want to
do.

Any suggestions?

Thank you,
Greg

Greg Larkin
Managing Member

SourceHosting.net, LLC
PO Box 1013
Hollis, NH 03049 US
user-c353e628177a@xymon.invalid
http://www.linkedin.com/in/greglarkin


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.
list Mark Hinkle · Wed, 12 Nov 2008 11:48:47 -0800 ·
FWIW, the netstat info is already being sent back to the hobbit server from the hobbit client (at least in the linux case I am looking at). If you look on your hobbit server at the data coming back from your clients in <hobbit_home>/data/hostdata/<hobbit_client>/*, I think you will see the netstat -rn output in there (with a bunch of other stuff). Although I have not done it, since the data is already on the hobbit server, seems like it should only be a matter of a hobbit-clients.cfg or hobbit-alerts.cfg config entries to match the routes you want.

-- 
Mark L. Hinkle
user-9816e24cee8c@xymon.invalid
list Henrik Størner · Wed, 12 Nov 2008 20:41:02 +0000 (UTC) ·
quoted from Gregory Larkin
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