Re: New to writing plugins.
Stanley Hopcroft <[email protected]>
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Ladies and Gentlemen,
Writing Netsaint/Nagios plugins is documented at
http://netsaintplug.sourceforge.net/doc/developer-guidelines/book1.html
and possibly at the Nagios site also.
Please note that this is a really a superset of what you need to know to
write plugins because this documents target audience is plugin
developers who must address standards and portability (if not style).
These matters are simply irrelevant if you want a qucik and dirty check
of _your_ application.
The fact that one can write _easy_ and _useful_ plugins in whatever
language you like [ provided that it has bindings to POSIX 1003.1
(probably a worong and fancy way of saying that you need to be able to
call the exit system call)] is one of the outstanding things about
Netsaint.
All your plugin must do is something like :-
#!/usr/bin/perl -w
use strict ;
use utils qw(%ERRORS)
# initialise
# check the service
my $ok = &some_complicated_business_logic(@a_lot_of_parameters) ;
exit $ERRORS{OK} if $ok ;
exit $ERRORS{CRITICAL} ;
It is that easy.
As another writer said, the plugin-scripts directory has lots of real
sample that should help you get started.
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:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf