O'Reilly logo

Mastering Bash by Giorgio Zarrelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Command and service definitions

At the base of everything in Nagios is a plugin, the minion who carries out the job of retrieving the information, evaluating it, raising the alarm, and providing a meaningful message. Left alone, Nagios does not know how to call a plugin, what options to pass to it or how to handle it, so we need a command definition, which defines how the script will be called.

Let's take as an example the command definition for the ssh service check, which is failing because the port used for the check is not the one the daemon is listening on:

# 'check_ssh' command definitiondefine command{command_name check_sshcommand_line /usr/lib/nagios/plugins/check_ssh '$HOSTADDRESS$'}

We can see here a command definition named  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required