Page 1 of 1

Monitor using SSH plugin to monitor Apache service?

Posted: Tue Sep 26, 2017 3:45 pm
by ikekim
I have Nagios XI installed and want to monitor remote Centos 7.x machine using SSH plugin.

I used the configuration wizard and I was able to add the IP address of this host and I can monitor the basics.

Now I'm running apache services so how do I reconfigure this setting so I can monitor the status of the Apache Services?

Under the edit configuration host I located the "monitor this host with this command" but I don't know where to find the commands.


thanks,
ik

Re: Monitor using SSH plugin to monitor Apache service?

Posted: Wed Sep 27, 2017 8:58 am
by tgriep
If you are already setup to monitor the basic settings, you can copy an existing service check, modify it and that will be the easiest way to do that.

It you ran the SSH Proxy wizard, it should of creates a service check called Total Processes.
You can use that one as the source. Go in to the Core Config Manager > Services menu, find that service check and copy it.
Edit the copy and update the Config Name, the Description and make sure it is active.
In the $ARG1$ field, put in the following to monitor the Apache Web server and the example below will generate a warning at 10 processes and a critical at 15, adjust those to your needs.

Code: Select all

/usr/local/nagios/libexec/check_procs -w 10 -c 15 -C httpd
Any questions, let us know.

Re: Monitor using SSH plugin to monitor Apache service?

Posted: Wed Sep 27, 2017 2:03 pm
by ikekim
@tgriep,

This is very good. It worked for me.

Is there a document that shows how to get all the commands to use for ssh plugin?

I probably need to find out how to track & monitor more services, processes, specific directory sizes, etc.


thanks!

Re: Monitor using SSH plugin to monitor Apache service?

Posted: Wed Sep 27, 2017 3:00 pm
by kyang
You can pretty much run any command and plugin as long as the client-server has those plugins/commands as well.

For example, on your XI command line the SSH Proxy wizard works like this. This is a plugin example.
The -C means "command to execute on the remote machine"

Code: Select all

usr/local/nagios/libexec/check_by_ssh -H 192.168.x.xxx -C "/usr/local/nagios/libexec/check_users -w 10 -c 20 /"
Except all you are able to see in XI is something like this, when you run the wizard. It's still the same concept.

Code: Select all

/usr/local/nagios/libexec/check_procs -w 10 -c 15 -C httpd
You can also check commands on linux like

Code: Select all

usr/local/nagios/libexec/check_by_ssh -H 192.168.x.xxx -C who
Result

Code: Select all

root     tty1         Sep 27 09:06
root     pts/0        Sep 27 09:08 (192.168.x.xxx)
I hope this helps, you can use a plugin to check for services, processes, and specific directory sizes.
Assuming you wanted to do this using the SSH Proxy Wizard and not anything else.

Re: Monitor using SSH plugin to monitor Apache service?

Posted: Mon Oct 02, 2017 9:34 am
by ikekim
@ kyang

Thanks for the response. All worked great.

ik

Re: Monitor using SSH plugin to monitor Apache service?

Posted: Mon Oct 02, 2017 9:36 am
by kyang
Sounds great! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!