i cant make non-official plugins to work

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

i cant make non-official plugins to work

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: i cant make non-official plugins to work

Post 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?
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: i cant make non-official plugins to work

Post 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.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post 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)
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: i cant make non-official plugins to work

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: i cant make non-official plugins to work

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Sander5
Posts: 37
Joined: Wed Sep 04, 2013 5:15 am

Re: i cant make non-official plugins to work

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: i cant make non-official plugins to work

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked