Page 1 of 1

Remote servers

Posted: Sat Nov 16, 2019 1:36 pm
by fsodah
In some section of my env. I have multiple servers running linux ... I am hosting them as colocation for clients ... these clients can be accessed from a deployment server which belong to our company this deployment server can access to these server with ssh-id without typing passwords ..
however the deployment server got on it nrpe and nagios plugins .... is it possible from the deployment server to watchgaurd these clients .... I want to see if the services on these clients are up such as http dba tomcat ...etc
On the clients I cant install anything ... since am not allowed

Re: Remote servers

Posted: Mon Nov 18, 2019 1:02 pm
by benjaminsmith
Hello @fsodah,

If you can directly access the clients from XI using ssh that would be the easiest to setup. Otherwise, one option would be to send passive check results collected by Nagios Core running on the deployment server using NRPD.

See: Distributed Monitoring With NRDP

If you are not able to install plugins directly on the client, it does limit what can be checked from NRPE/Nagios.

Re: Remote servers

Posted: Mon Nov 18, 2019 1:10 pm
by cdienger
If the services open up ports that your deployment server can access then the deployment server can verify that client services are up using a plugin like check_tcp. This simply checks to see if a port is up and listening. Checks like check_http, check_ssh, check_mysql_health, etc... can be used to connect to services if you need more than a tcp handshake to verify a service is working.

Re: Remote servers

Posted: Mon Nov 18, 2019 1:31 pm
by lmiltchev
You can also try the following:

1. On the clients, you may set up something like this in sudoers:

Code: Select all

Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /sbin/service *
2. On the server with NRPE installed, you could add a command as this one:

Code: Select all

command[check_httpd_remote]=/usr/local/nagios/libexec/check_by_ssh -H <client ip> -C "sudo service httpd status"
Note: Make sure that the Nagios XI ip address is added to the "allowed_hosts" line in nrpe.cfg file.

3. Test it from the command line on the Nagios XI server:

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_nrpe -H <ip address of the deployment server> -c check_httpd_remote
Example:

Code: Select all

[nagios@TEST_XI_CentOS_6 ~]$ /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_httpd_remote
httpd (pid  26289) is running...

Re: Remote servers

Posted: Tue Nov 19, 2019 2:44 pm
by fsodah
let me try this ,,, i need some time to figure it out ... let me get back to my office i will test it ... and update you .. please keep it open the ticket

Re: Remote servers

Posted: Tue Nov 19, 2019 3:25 pm
by lmiltchev
Sure, we will keep the topic open. Let us know if you have any further questions.

Re: Remote servers

Posted: Wed Nov 20, 2019 1:40 pm
by fsodah
decided to install nrpe on all clients to get a proper data analysis .... please close the ticket.

Re: Remote servers

Posted: Wed Nov 20, 2019 2:20 pm
by mbellerue
Okay, thank you for reporting back. We'll close it up.