Plugin Trouble

Jon Angliss jon at netdork.net
Sun Nov 2 05:39:05 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 30 Oct 2008 15:36:31 -0400 (EDT), "Bo Lynch"
<blynch at ameliaschools.com> wrote:

>On Thu, October 30, 2008 3:19 pm, Charles Breite wrote:
>> It looks like you need the -C for the community
>> Here is an example of mine
>>     $USER1$/check_snmp_int -2 -i -H $HOSTADDRESS$ -C $ARG1$ -n
>> $ARG2$
>>
>>
>> -----Original Message-----
>> From: Bo Lynch [mailto:blynch at ameliaschools.com]
>> Sent: Thursday, October 30, 2008 1:18 PM
>> To: nagios-users at lists.sourceforge.net
>> Subject: [Nagios-users] Plugin Trouble
>>
>> I am trying to use the check_snmp_printer plugin to monitor a few printers
>> on the network. I am able to use it via the bash shell with
>> ./check_snmp_printer 192.168.x.x public CONSUM ALL. However when I define
>> it in objects/commands.cfg and make a .cfg file for a printer I get a
>"usage is:  " in nagios
>>
>> Here is how I have defined the command in commands.cfg
>> # 'check_snmp_printer' command definition
>> define command{
>>         command_name    check_snmp_printer
>>         command_line    $USER1$/check_snmp_printer $HOSTADDRESS$ $ARG1$
>> $ARG2$
>>         }
>> I'm thinking its something with the way I have it defined. Any input would
>> be greatly appreciated.
>> Thanks
>> --
>> Bo Lynch
>>
>
>Thanks for the info. I am using the bash version of the script not the
>perl version so it takes no swicthes like -C -H and such. I did however
>manage to figure it out. command.cfg =
># 'check_snmp_printer' command definition
>define command{
>        command_name    check_snmp_printer
>        command_line    $USER1$/check_snmp_printer $ARG1$ $ARG2$ $ARG3$ }
>
>service def.......
>define service{
>        use                     generic-service
>        host_name               ACHS Lounge
>        service_description     Printer Consumables
>        check_command
>check_snmp_printer!192.168.1.238!public!CONSUM ALL
>normal_check_interval   10
>        retry_check_interval    1
>        }
>Thanks everybody.
>

This seems a little bit of an odd change, but I'm not sure how you
have your hosts defined.  Do you have a host defined for each printer?
Or do you have a single host, with multiple printer tests assigned? If
you're using a single host per printer, passing in the IP address for
the printer into the service is a little odd.  The original definition
for the command was OK, it looks like you probably just needed to drop
the IP address. ie:

define service {
  [...]
  check_command  check_snmp_printer!public!CONSUM ALL
}

The command definition would get the host address from the other
macros.  You can then use hostgroups to assign services to a batch of
printers that have the same tests.

- -- 
Jon Angliss

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32) - GPGshell v3.64

iEYEARECAAYFAkkNLuEACgkQK4PoFPj9H3MEXwCfesbTvw1/Iti1QY4fCyjCMwrJ
0vYAnAvJ/lD56gRoCXxhWWDN7SINEOiG
=3+2z
-----END PGP SIGNATURE-----


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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