Page 1 of 6

i cant make non-official plugins to work

Posted: Wed Sep 04, 2013 6:37 am
by Sander5
I have installed nagios 3 on FreeBSD 7.1.0 .

I was asked to monitor certain devices (canon printers/switches) the official plugins work but i needed more detailed information. like toner levels or port bandwidth usage. have read alot of documents and tutorials, but i am still a bit unsure how to install non-official plugins. i use notepad++ and winSCP to install the plugins. but before i used to copy tekst from notepad++ and right click in putty.

i edited the commands.cfg and the printers.cfg/switches.cfg. mostly i get the following output: Usage: and Null()

This is very confusing i dont know where to look.

Re: i cant make non-official plugins to work

Posted: Wed Sep 04, 2013 9:19 am
by slansing
Depending on the plugins, they have to either be in the correct plugins directory on the nagios server, or the remote host. How are you executing them? Do you know where they should be residing?

Can you share a command definition, and service definition of one of them, as well as attaching the plugin here so we can see it?

Re: i cant make non-official plugins to work

Posted: Thu Sep 05, 2013 2:01 am
by Sander5
/usr/local/libexec/nagios : this is where the plugins are installed in freebsd (i dont know about ubuntu or other but those where slightly different)

i used ./check_snmp_printer that didnt work then i used bash check_snmp_printer and (i forgot to mention in last post) it gave this error:

UNKNOWN: check_snmp_printer: No usable 'xxd' binary in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin'

define command{
command_name check_snmp_printer
command_line $USER1$/check_snmp_printer -H $HOSTADDRESS$ -C $ARG1$ -x $ARG2$ -w $ARG3$ -c $ARG4$
}

define service{
use generic-service
host_name printer01
service_description printer status
check_command check_snmp_printer!192.168.1.1!public!"CONSUM ALL"!20!10
}

i also checked the printer SNMP via snmpwalk and it answered correctly.

Thanks for the reply. it is becoming quite confusing for me, dont know where to look. it will probably be my fault because i do not have a very extensive knowledge of freebsd/nagios or writing, understanding bash scripts.

Re: i cant make non-official plugins to work

Posted: Thu Sep 05, 2013 9:39 am
by slansing
Where did you download that plugin from? If we can get a copy, we can open it up and hopefully figure out what you need to do.

Re: i cant make non-official plugins to work

Posted: Thu Sep 05, 2013 10:10 am
by Sander5
http://exchange.nagios.org/directory/Pl ... ck/details
Thats the plugin i used.

A short while ago i reconfigured snmpd (http://blog.up-link.ro/freebsd-how-to-i ... n-freebsd/). now instead of (null) or usage: i get the help from the script in the display on the nagios site.

(i may not awnser in a few days)

Re: i cant make non-official plugins to work

Posted: Thu Sep 05, 2013 2:11 pm
by sreinhardt
The error from the plugin is complaining that you do not have xxd, a hex application. You should definitely be able to install this via the ports system, alternatively if installed already you need to make sure it's path is in the nagios users PATH variable.

Re: i cant make non-official plugins to work

Posted: Mon Sep 09, 2013 7:16 am
by Sander5
I managed to install XXD. (i discovered it was actually a tool from within vim) Then i tried to run the script, and it worked! i could see the toner levels in % and warnings and such.

I cannot find the 'nagios users PATH variable'. could this be why the plugins give the UNKNOWN status?

Re: i cant make non-official plugins to work

Posted: Mon Sep 09, 2013 2:04 pm
by sreinhardt
well if it is running correctly, then you should have no need to modify path. Otherwise I would probably suggest su-ing to the nagios user and checking path from there.

Re: i cant make non-official plugins to work

Posted: Tue Sep 10, 2013 3:38 am
by Sander5
I cant figure out what you mean by: "su-ing to the nagios user and checking path from there."

I checked the internet and came up with this command: echo $PATH (as user nagios) it showed this: /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/var/spool/nagios/bin (is this what you mean?)

I am sorry if i ask Obvious or dumb questions i am still learning nagios and freebsd.

Re: i cant make non-official plugins to work

Posted: Tue Sep 10, 2013 10:25 am
by sreinhardt
By su-ing I mean that you change user to the nagios user, such as 'su nagios' Then, yes echo $PATH would show your path locations. Is xxd contained in one of those directories?