I’ve been deepdiving in to nagios/icinga to create a futureproof monitoring platform in our organization.
At the moment, I’m trying to visualize our printer environment.
Instead of using custom SNMP commands, I wanted to use the allround check_printer_health command.
I see the command is available to use, but when used, it lets me know it cannot find the executable.
I’ve been searching through docs on icinga and also nagios and I see now that this command is not part of the monitoring project. I suspect the command used can be found here (https://labs.consol.de/nagios/check_printer_health/), which I remember seeing before.
Now I’m at a loss on how to get that into my enviroment (Debian 4.19.98-1). I’ve seen commands for nagios to get custom plugins, but I’m not sure this is what I’m looking for.
I’m sorry but miscommunicated the debian version.
It should be this: Description: Debian GNU/Linux 10 (buster)
It’s a new install (colleague did the install, hence why I didn’t knew the version).
I’ve read the advice to check for installation manual, but not all plugins provide that.
So if I understand correctly, I should find a package which I put in the plugin-dir. If not, look for instructions?
# apt install libnet-snmp-perl
# mkdir -pv /usr/lib/nagios/plugins/contrib
# wget https://labs.consol.de/assets/downloads/nagios/check_printer_health-1.1.0.1.tar.gz --directory-prefix=/tmp
# cd /tmp
# tar xzvf check_printer_health-1.1.0.1.tar.gz
# cd check_printer_health-1.1.0.1
# ./configure --libexecdir=/usr/lib/nagios/plugins/contrib
# make
# make install
Probably there are some other perl dependencies needed but I have no Debian to hand so I just can guess the others but net-snmp is pretty sure required.
@Al2Klimov Debian 4.19.98-1 is related to the used kernel which is a Debian Buster kernel so far.
What you call “default plugins” are actually plugins which are provided by distribution package manager.
So they are managed by “package manager” means they could be hit by everything I will do through package manager, e.g. updates, remove etc. Thats why I create a contrib folder where all my plugins I brought myself to the system will reside. So nobody can touch them and I’m able to differentiate by mine or system plugins
Though you can’t use the ITL commands, if you put the plugins in a different folder, as the ITL commands are configured with the PluginDir constant which points to the default plugin folder that
is /usr/lib/nagios/plugins. (If I`m not mistaken)
Other than that you post is the solution for this topic
There are some mechanics implemented in the ITL. In order to use this you have to configure the “PluginContribDir” constant to use the contrib schema. By default all PluginDir constants point to the same folder for compatibility reasons but to create a seperate contrib folder is considered as best practise.
Hello there!
I checked with one of the devs whether Maksyms suggestion works, and it looks pretty good to me
Did you try it out yet @terryprosafco?
Would be cool if you’d mark it as the solution, if it works for you
Have a nice day,
Feu
The printer_health command is pre-defined in the ITL. The path there points to /usr/lib/nagios/plugins.
So if I install the script to the /contrib folder and enable the PluginContribDir constant and point it to that new folder, I can use the default printer_health command from the ITL?
@theFeu: it works, but as you see there’s some discussion about the path, that’s why I haven’t marked or closed. If you copy the solutions 1 on 1, it doesn’t work because you have to put in place the contrib folder to be used.
@m4k5ym: I understand the best practice approach, but both being fairly new to icinga and linux, I first wanted to make sure I got it working and the plugin does what I’m after.