openssh status

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

openssh status

Post by vvz »

Hello!
installed nagios3 on Linux Mint. Everything looks good and working,
except: localhost servise ssh - > status ->critical
openssh-server is not installed, only ssh-client
Is it a problem? check_ssh checks only ssh-server?

I also have virtual machine (centos64 openssh-server is installed), I can ping it and all other services checked by Nagios successfully , but the same problem
on Nagios web-interface it says for CentOS host ->ssh status-> critical.
Firewalls desabled on host and virtual CentOS
Any ideas? What shall I do to bring status to OK?
Thank you for your help
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: openssh status

Post by tmcdonald »

vvz wrote:Hello!
installed nagios3 on Linux Mint. Everything looks good and working,
except: localhost servise ssh - > status ->critical
openssh-server is not installed, only ssh-client
Is it a problem? check_ssh checks only ssh-server?
Yes, you need to install a ssh server for the check to work.
vvz wrote: I also have virtual machine (centos64 openssh-server is installed), I can ping it and all other services checked by Nagios successfully , but the same problem
on Nagios web-interface it says for CentOS host ->ssh status-> critical.
Firewalls desabled on host and virtual CentOS
Any ideas? What shall I do to bring status to OK?
Thank you for your help
Are you able to ssh into the CentOS machine from your Nagios machine?
Former Nagios employee
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: openssh status

Post by vvz »

sorry, it's clear now
thank you for your help

now I do now so worry about remore machine
what about local host?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: openssh status

Post by tmcdonald »

I'm not sure I understand your question.

What do you need help with regarding localhost?
Former Nagios employee
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: openssh status

Post by vvz »

now I've installed openssh- server on my localhost
in my-host.cfg I have
define service{
use generic-service
host_name localhost
service_description SSH
check_command check_ssh localhost
}

when I run # nagios3 -v /etc/nagios3/nagios.cfg

it gives 1 error

when I comment this section it has no errors
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: openssh status

Post by tmcdonald »

Can you provide the error given? Also, please run the "check_ssh localhost" command from the command line and provide the output.
Former Nagios employee
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: openssh status

Post by vvz »

check_ssh localhost
WARNING:root:could not open file '/etc/apt/sources.list'

check_ssh: command not found
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: openssh status

Post by vvz »

chkng

Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios3/commands.cfg'...
Processing object config directory '/etc/nagios-plugins/config'...
Processing object config file '/etc/nagios-plugins/config/dns.cfg'...
Processing object config file '/etc/nagios-plugins/config/games.cfg'...
Processing object config file '/etc/nagios-plugins/config/fping.cfg'...
Processing object config file '/etc/nagios-plugins/config/snmp.cfg'...
Processing object config file '/etc/nagios-plugins/config/hppjd.cfg'...
Processing object config file '/etc/nagios-plugins/config/ifstatus.cfg'...
Processing object config file '/etc/nagios-plugins/config/ftp.cfg'...
Processing object config file '/etc/nagios-plugins/config/procs.cfg'...
Processing object config file '/etc/nagios-plugins/config/rpc-nfs.cfg'...
Processing object config file '/etc/nagios-plugins/config/http.cfg'...
Processing object config file '/etc/nagios-plugins/config/load.cfg'...
Processing object config file '/etc/nagios-plugins/config/tcp_udp.cfg'...
Processing object config file '/etc/nagios-plugins/config/apt.cfg'...
Processing object config file '/etc/nagios-plugins/config/radius.cfg'...
Processing object config file '/etc/nagios-plugins/config/mailq.cfg'...
Processing object config file '/etc/nagios-plugins/config/news.cfg'...
Processing object config file '/etc/nagios-plugins/config/netware.cfg'...
Processing object config file '/etc/nagios-plugins/config/dummy.cfg'...
Processing object config file '/etc/nagios-plugins/config/nt.cfg'...
Processing object config file '/etc/nagios-plugins/config/flexlm.cfg'...
Processing object config file '/etc/nagios-plugins/config/mrtg.cfg'...
Processing object config file '/etc/nagios-plugins/config/mysql.cfg'...
Processing object config file '/etc/nagios-plugins/config/breeze.cfg'...
Processing object config file '/etc/nagios-plugins/config/telnet.cfg'...
Processing object config file '/etc/nagios-plugins/config/dhcp.cfg'...
Processing object config file '/etc/nagios-plugins/config/mail.cfg'...
Processing object config file '/etc/nagios-plugins/config/ldap.cfg'...
Processing object config file '/etc/nagios-plugins/config/check_nrpe.cfg'...
Processing object config file '/etc/nagios-plugins/config/users.cfg'...
Processing object config file '/etc/nagios-plugins/config/ping.cfg'...
Processing object config file '/etc/nagios-plugins/config/pgsql.cfg'...
Processing object config file '/etc/nagios-plugins/config/ntp.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk.cfg'...
Processing object config file '/etc/nagios-plugins/config/real.cfg'...
Processing object config file '/etc/nagios-plugins/config/ssh.cfg'...
Processing object config file '/etc/nagios-plugins/config/disk-smb.cfg'...
Processing object config directory '/etc/nagios3/conf.d'...
Processing object config file '/etc/nagios3/conf.d/generic-service_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/contacts_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/extinfo_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/my-hosts.cfg'...
Processing object config file '/etc/nagios3/conf.d/generic-host_nagios2.cfg'...
Processing object config directory '/etc/nagios3/conf.d/ngraph'...
Processing object config directory '/etc/nagios3/conf.d/ngraph/serviceext'...
Processing object config file '/etc/nagios3/conf.d/ngraph/commands.cfg'...
Processing object config file '/etc/nagios3/conf.d/services_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/localhost_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/timeperiods_nagios2.cfg'...
Processing object config file '/etc/nagios3/conf.d/hostgroups_nagios2.cfg'...
Warning: Duplicate definition found for service 'SSH' on host 'localhost' (config file '/etc/nagios3/conf.d/services_nagios2.cfg', starting on line 11)
Warning: Duplicate definition found for service 'PING' on host 'centos' (config file '/etc/nagios3/conf.d/my-hosts.cfg', starting on line 30)
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: Service check command 'check_ssh localhost' specified in service 'SSH' for host 'localhost' not defined anywhere!
Checked 11 services.
Checking hosts...
Checked 2 hosts.
Checking host groups...
Checked 5 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 3 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 157 commands.
Checking time periods...
Checked 4 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: openssh status

Post by abrist »

vvz wrote: Checking services...
Error: Service check command 'check_ssh localhost' specified in service 'SSH' for host 'localhost' not defined anywhere!
Your check command is incorrect. It should just be:

Code: Select all

define service{
use generic-service
host_name localhost
service_description SSH
check_command check_ssh
}
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: openssh status

Post by tmcdonald »

vvz wrote:check_ssh localhost
WARNING:root:could not open file '/etc/apt/sources.list'

check_ssh: command not found
You will need to provide the full path name to the command:

/usr/lib/nagios/plugins/check_ssh localhost

^ That should be correct on your system.


vvz wrote: define service{
use generic-service
host_name localhost
service_description SSH
check_command check_ssh localhost
}
Try adding "register 1" to the end of your services just to be sure, and making the change abrist suggested:

Code: Select all

define service{
use generic-service
host_name localhost
service_description SSH
check_command check_ssh
register 1
}
Former Nagios employee
Locked