1st post to the group, basic q ... I think

James Pratt jpratt at norwich.edu
Wed Feb 25 01:43:23 CET 2009



> -----Original Message-----
> From: Lance Raymond [mailto:lraymond at weatherflow.com]
> Sent: Tuesday, February 24, 2009 4:41 PM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] 1st post to the group, basic q ... I think
> 
> ok, I am closer, but still unclear on the check_command and the define
service part (I
> will try to read more 2nt) but I can run in manually as nagios from
the cli;
> 
> ./check_snmp_load.pl -H 1.1.1.1 -C community -w 3,3,2 -c 4,4,3 -T
netsl Load : 4.37
> 4.27 4.20 : 4.37 > 4 : CRITICAL 4.27 > 4 : CRITICAL 4.20 > 3 :
CRITICAL
> 
> so that works.  Now in the command.cfg I have the following;
> 
> define command{
>    command_name check_snmp_load_v1
>    command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T
> $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ -C community }
> 
> and the server.cfg I have;
> 
> define service{
>         use                             local-service         ; Name
of service$
>         host_name                       bigbird
>         service_description             Current Load via SNMP
>         check_command
check_snmp_load_v1!netsl!3,3,2!4,4,3
>  }
> 
> I have played numerous times, that is the latest, I am trying to
understand where the
> $ARG variables are defined (and how).  I assume the $HOSTADDRESS is
just by the
> server.cfg file, but not sure on $USER7$ as well as push the other
$ARG$ one's,
> becuase as you see from the cli hand entering the info it works!
> 

Yes, $HOSTADDRESS$ that is used by commands.cfg is defined in the
service definition as 'host_name' 

$ARG1$, $ARG2$, etc are just that - in your definition above, $ARG1$ =
netsl , $ARG2$ = 3,3,2 $ARG3$ = 4,4,3 (and so on)..

(Not sure why you cannot execute it via nagios but can do so by hand -
try running it as the nagios user using "su - nagios -c "command here"

Hth..

Regards,
Jamie

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list