How to use check_printer_health plugin/command


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 (, 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.

Any suggestions?

Hello @terryprosafco!

Debian… 4.x?! A 2007 distro? I’m afraid you couldn’t even put the latest Icinga on it.

Anyway, if your distro doesn’t package a particular plugin, you should consult its installation manual.



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?

1 Like


# apt install libnet-snmp-perl
# mkdir -pv /usr/lib/nagios/plugins/contrib
# wget --directory-prefix=/tmp
# cd /tmp
# tar xzvf check_printer_health-
# cd check_printer_health-
# ./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.


1 Like

Is there a reason you would create an extra folder “contrib” to install that in?
All default plugins reside in one folder up.


of course there is a reason :slight_smile:

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 :smiley:



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 :slight_smile:

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.

I’m glad that it worked for you! :smiley:

1 Like

Hello there!
I checked with one of the devs whether Maksyms suggestion works, and it looks pretty good to me :slight_smile:
Did you try it out yet @terryprosafco?
Would be cool if you’d mark it as the solution, if it works for you :slight_smile:
Have a nice day,

Just to clarify, because I’m a bit confused:

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?

This does not sound logical for me.

@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.