|
From: Subhendu G. <sg...@sg...> - 2002-09-04 21:36:45
|
inline.. Add the exit -- I'm not a ksh user, but that should work...
On Wed, 4 Sep 2002, Edgard Dap=E1s wrote:
>=20
> I send my script, with the exits
>=20
> # pwd
> /usr/local/netsaint
> # more check_notes.sh
> #!/bin/ksh
>=20
> data=3D`cat /usr/local/netsaint/proc_notes.txt`
> FLAG=3D'OK'
> for i in $data
> do
> PROC=3D`ps -ef | grep $data| wc -l`
> if [ $PROC =3D 0 ]
> then
> FLAG=3D'Critical'
> =20
echo $FLAG
exit 2
> break
> fi
> done
> echo $FLAG
exit 0
>=20
>=20
> So I have 2 posible exits from it, "OK" and "Critical"
>=20
> Thank you very much
>=20
>=20
>=20
>=20
>=20
> Subhendu Ghosh <sg...@sg...>@lists.sourceforge.net con fecha
> 04/09/2002 17:58:14
>=20
> Enviado por: net...@li...
>=20
>=20
> Destinatarios: net...@li...
> CC:
> Asunto: Re: [Netsaintplug-help] Writing a new plugin
>=20
>=20
>=20
> Everything looks good except for the exit state for the check_notes
> plugin.
>=20
>=20
> When the check_notes plugin terminates with a Critical, what is the exi=
t
> code being used? If you are using just "exit" that implies "exit 0"
> which is OK. You need to exit with "exit 2" for a critical status.
>=20
> -sg
>=20
>=20
> On Wed, 4 Sep 2002, Edgard Dap=E1s wrote:
>=20
> >
> > I write my pluging check_notes:
> >
> > 1- I declare it on the nrpe.cfg (client machine)
> > # grep check_notes nrpe.cfg
> > command[check_notes]=3D/usr/local/netsaint/check_notes.sh
> >
> > 2- I declare the plugin in netsaint machine, file host.cfg
> >
> > # grep check_notes hosts.cfg
> >
> >
> service[dsl102]=3DNOTES;0;24x7;1;2;1;webpin;120;24x7;1;1;0;;check_nrpe!=
check_notes
>=20
> >
> >
> > 3- when I run the command from the prompt I get the following responc=
e
> >
> > When the notes is down:
> > # /opt/sfw/lib/netsaint/plugins/check_nrpe 10.74.72.43 -c
> > check_notes
> > Critical
> >
> > When the notes is UP
> > # /opt/sfw/lib/netsaint/plugins/check_nrpe 10.74.72.43 -c
> > check_notes
> > OK
> >
> > 4- In the status.log, I have the followin message, when the service i=
s UP
> >
> > [1031166917]
> SERVICE;dsl102;NOTES;OK;1/1;HARD;1031166845;1031166965;ACTIVE;1;1;1;103=
1129137;0;OK;69196;0;0;400;0;0;1;0;0;1;0;0.00;0;
>=20
> > OK
> >
> > when the service is down, i have the folowing message
> >
> > [1031166917]
> SERVICE;dsl102;NOTES;OK;1/1;HARD;1031166845;1031166965;ACTIVE;1;1;1;103=
1129137;0;OK;69196;0;0;400;0;0;1;0;0;1;0;0.00;0;
>=20
> > Critical
> >
> > But, only status information change, the current status only change =
when
> the plugin can't be execute.
> >
> > Should I declare my plugin like a new command in the COMMAND
> CONFIGURATION section in the hosts.cfg
> >
> > Thanks
> >
> >
> >
> >
> >
> >
> >
> >
> > Subhendu Ghosh <sg...@sg...>@lists.sourceforge.net con fecha
> > 04/09/2002 15:58:32
> >
> > Enviado por: net...@li...
> >
> >
> > Destinatarios: net...@li...
> > CC:
> > Asunto: Re: [Netsaintplug-help] Writing a new plugin
> >
> >
> > On Wed, 4 Sep 2002, Edgard Dap=E1s wrote:
> >
> > >
> > > Just one question
> > >
> > > I write a plugin, do I have to declare it in the hosts.cfg or in
> > > command.cfg?
> > >
> > > Even if I want to execute it in a remote machine?
> > >
> > > Could you send me an example, please
> > >
> > > Because, I have problem with the service status
> > >
> > > Thanks
> > >
> >
> > Take a look at the plugin developers guidelines on the nagiosplug
> > homepage.
> >
> > If you are going to execute it on a remote system, are you using NRPE=
as
> a
> > conduit between the monitoring host and the target? If so, you need =
an
> > entry for the plugin and all its parameters in nrpe.cfg.
> >
> > On the netsaint side, you need an entry for check_nrpe in commands.cf=
g
> > (should be there already) and an entry in hosts.cfg for a service che=
ck
> > using check_nrpe with arg=3Dplugin name defined in nrpe.cfg
> >
> > Hope this helps.
> > --
> >
> > -sg
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by: OSDN - Tired of that same old
> > cell phone? Get a new here for FREE!
> > https://www.inphonic.com/r.asp?rsourceforge1&refcode1vs3390
> > _______________________________________________
> > Netsaintplug-help mailing list
> > Net...@li...
> > https://lists.sourceforge.net/lists/listinfo/netsaintplug-help
> > http://netsaintplug.sf.net/
> > http://sf.net/projects/netsaintplug/
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by: OSDN - Tired of that same old
> > cell phone? Get a new here for FREE!
> >
> https://www.inphonic.com/r.asp?r_______________________________________=
________
>=20
> > Netsaintplug-help mailing list
> > Net...@li...
> > https://lists.sourceforge.net/lists/listinfo/netsaintplug-help
> > http://netsaintplug.sf.net/
> > http://sf.net/projects/netsaintplug/
> >
>=20
> --
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?rsourceforge1&refcode1vs3390
> _______________________________________________
> Netsaintplug-help mailing list
> Net...@li...
> https://lists.sourceforge.net/lists/listinfo/netsaintplug-help
> http://netsaintplug.sf.net/
> http://sf.net/projects/netsaintplug/
>=20
>=20
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by: OSDN - Tired of that same old
> cell phone? Get a new here for FREE!
> https://www.inphonic.com/r.asp?r_______________________________________=
________
> Netsaintplug-help mailing list
> Net...@li...
> https://lists.sourceforge.net/lists/listinfo/netsaintplug-help
> http://netsaintplug.sf.net/
> http://sf.net/projects/netsaintplug/
>=20
--=20
|