SERVICE ALERT: localhost;SSH;CRITICAL;HARD;4;Connection refu


#1

I am getting this error:

SERVICE ALERT: localhost;SSH;CRITICAL;HARD;4;Connection refused

Any ideas on how to resolve this? Thanks.


#2

Could this error being caused by ssh running on a different port? If so, where would I go to configure it?


#3

Find the /nagios-plugins/config folder and in there you will find several files in which you define commands. I would suggest creating a new file there naming it for example user_check_sql.cfg, just in case upgrading Nagios would replace files in there. Copy and paste one command definition from mysql.cfg to your user_check_mysql.cfg file.
When you edit the user_check_mysql.cfg file, check the arguments after command beside command_line part. There you can put the switch -P <port_number>

Example how it should look like for port 13306:
define command{
command_name user_check_mysql
command_line /usr/lib/nagios/plugins/check_mysql -H $HOSTADDRESS$ -P 13306 -u username -p password
}

Then use the command_name in the service definition when defining check_command


#4

Thank you!