Monitor using SSH plugin to monitor Apache service?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

Monitor using SSH plugin to monitor Apache service?

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitor using SSH plugin to monitor Apache service?

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

Re: Monitor using SSH plugin to monitor Apache service?

Post 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!
kyang

Re: Monitor using SSH plugin to monitor Apache service?

Post 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.
ikekim
Posts: 85
Joined: Wed Aug 16, 2017 12:21 pm

Re: Monitor using SSH plugin to monitor Apache service?

Post by ikekim »

@ kyang

Thanks for the response. All worked great.

ik
kyang

Re: Monitor using SSH plugin to monitor Apache service?

Post 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!
Locked