Re: [Netsaintplug-devel] plugin to check route?
Stanley Hopcroft <[email protected]> Fri, 24 Jan 2003 09:43:04 +1100
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Sir, I am writing to thank you for your letter and say, On Thu, Jan 23, 2003 at 11:24:43AM +0100, Vinther Jonas Struer wrote: > I want to write a small plugin to check the routes for our router setup. > > > > The primary use for the program, are to check if our backup routers are > active. > > I thought of writing a small shell script that runs a "ping -r" or > "tracerroute" to a remote host. Then I could filter the results to see if a > bad router where in the route, and then netsaint would return an error to > the status. > Have a look in the standard plugin distribution (distro) for plugins that may already provide this function. Many people use SNMP to check their routers. There is also a check_bgpstate.pl in the contib sub-dir. > > > I just dont know, what error codes to return, or if it is possible to use > shell scripts as plugins... > Plugins can be written in any language that lets you to write (send output) to STDOUT and that has an interface to the POSIX system call named exit. Here is an example plugin, #!/bin/sh # Not much use for anything printf "I'm Ok.\n" exit 0 Have a look at the plugin-scripts dir of the plugin distro to see some serious but tractable examples. You should have a look at the excellent plugin documentation at http://nagios.sourceforge.net/docs/1_0/plugins.html#howto > > > I know, ultra very little of C programming.... ;-) > > > > I think that a plugin that could do this, would be usefull for all companies > that has backup routers, and want to monitor when the backup routers are > active. > > > > > > Med venlig hilsen / Yours sincerely > > Jonas Struer Vinther > > > > Technician, Intern > > Danfoss A/S > > > Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com