Plugin issue

Andy Shellam (Mailing Lists) andy.shellam-lists at mailnetwork.co.uk
Sun Jan 14 11:28:06 CET 2007


tyrus at icsit.jkuat.ac.ke wrote:
>> Don't forget to copy the mailing list in so others can chip in and help.
>>     
Read the above line again!!
> HI Andy am kinda confused here: when you say i insert the values
> "2000,25%" to the $ARG1$ and $ARG2$ respectively do you mean that i should
> insert them in the check_ping command defination or what??
> Kindly explain!
> Thanks
>   
OK there are a few ways of doing it - in your current definition, you 
need something like this "2000,25%" in anything that uses your 
check_ping command - i.e. host, service, whatever.
I'll show you an example using a host definition.

Firstly, the way you're doing it:

define command {
         command_name    check_ping
         command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
}

You need to be passing, for example, 2000,25% as $ARG1$ and, for 
example, 4000,50% as $ARG2$.
So, your object definition (in this example, host) will need to be as 
follows:

define host {
    ...
    check_command            cmd-Ping!2000,25%!4000,50%
    ...
}

Your check_ping command will then turn out to be something like: 
"/usr/local/nagios/libexec/check_ping -H 127.0.0.1 -w 2000,25% -c 
4000,50% -p 5"

The second way is the way I'm doing it at the moment.
The check_ping command:

define command {
    command_name            cmd-Ping
    command_line            $USER1$/check_ping -p 3 -t 10 -4 -H $ARG1$ 
-w $ARG2$,$ARG3$% -c $ARG4$,$ARG5$%
}

The object definition:

define host {
    ...
    check_command            cmd-Ping!$HOSTADDRESS$!1000!20!2000!50
    ...
}

As you can see, a few more arguments need to be passed from the object, 
but you can override any of the thresholds for one particular object.

Another way is simply to "hard-code" the values in your command, and 
have no arguments passed in from the object.

The command:

define command {
    command_name            cmd-Ping
    command_line            $USER1$/check_ping -p 3 -t 10 -4 -H 
$HOSTADDRESS$ -w 2000,25% -c 4000,50%
}

The object:

define host {
    ...
    check_command            cmd-Ping
    ...
}

Hopefully this clears things up - but *don't forget to copy the mailing 
list in* to your replies - hit "Reply to all" in your mailer and it'll 
sort it out for you.

-- 
Andy Shellam
NetServe Support Team

the Mail Network
"an alternative in a standardised world"



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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