SSH is an easy and secure way, to execute monitoring plugins on a remote host.
If you don't have a SSH-Key for your user
nagios yet, you need to create one.
su nagios mkdir /var/lib/nagios/.ssh ssh-keygen
Also you should import the ssh host key of the target host right now:
ssh <target-host> and just confirm with
For this example you need to install the
monitoring-plugins on the target host.
apt-get install nagios-plugins
In the next step create a new user
monitoring which will be used to execute the checks via SSH.
addgroup --system monitoring adduser --system --shell /bin/bash monitoring adduser monitoring monitoring mkdir -p /home/monitoring/.ssh/ chown monitoring:monitoring /home/monitoring -R touch /home/monitoring/.ssh/authorized_keys chmod 644 /home/monitoring/.ssh/authorized_keys
Now copy your public key to the file
Objects Commands and make sure that the
check_by_ssh command exists. It's a default command of openITCOCKPIT.
If the command is missing on your system press on + New to create it.
|Command type||Service check command|
|Command arguemnt ($ARG1)||
|Command arguemnt ($ARG2)||
The check_by_ssh plugin can be used to execute all types of commands on the remote maschine. To run check plugins it is required to set the full path to the plugin. To avoid a lot of work and keep things flexible its recommended to use a Macro to store the plugin path.
Go to Objects User Defined Macros and press on + New.
Navigate to Services and press on + New.
Select your host and chosse the predefined service template
To continue press Create service.
$USER2$ will be automatically replaced with the value from the macro defined earlier.
Repeat this step for as many services as you like.
To enable the new configuration, you need to run Refresh monitoring configuration.
Press Launch refresh to apply the new configuration.
The new services will be now monitored by the system:
© 2021 it-novum GmbH - All Rights Reserved