Nagios change ssh port

 

By default nagios check sshd/ssh service on port 22.

Let’s say if we are using a nonstandard port for ssh(Example:3333), we need to update port details in services_nagios2.cfg

Open /etc/nagios3/conf.d/services_nagios2.cfg with any editor and search for ssh-servers, where you can find check_command and update its value. Whole define service block should look like below:

define service {
hostgroup_name ssh-servers
service_description SSH
check_command check_ssh_port!3333
use generic-service
notification_interval 0 ; set > 0 if you want to be renotified
}

After updating services_nagios2.cfg file save and exit from it.

Now restart both services nagios-nrpe-server, and nagios3 by using following commands:

$ service nagios-nrpe-server restart

$ service nagios3 restart

-Sany

By Sandeep Posted in Nagios

4 comments on “Nagios change ssh port

  1. Pingback: BLOG SŁONIA :) » Blog Archive » Zmiana portu ssh monitorowanego przez nagios

  2. with check_command check_ssh_port!3333 (my ssh port)
    i am having an error!
    Check your configuration file(s) to ensure that they contain valid directives and data defintions.

Leave a comment