Checking via SSH

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2454
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Checking via SSH

Post by BanditBBS »

We have started checking some servers via ssh, and not the conventional method. we are not using the check_by_ssh method or connecting and running script installed on the remote machine. Instead, we are using this command(with ssh keys set between the servers):

Code: Select all

ssh nagios@$HOSTADDRESS$ 'bash -s' -- < $USER1$/$ARG1$ $ARG2$
And then we are using some custom scripts to do the basic disk, mem and cpu checks. Is there any issue doing checks using this method that you can think of? The checks have to be a script, can't be a compile program like the default check_mem or check_disk is the biggest issue I can think of, any others?

This group wants to use this method so the scripts don't need copied and/or updated multiple places, just the nagios server.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Checking via SSH

Post by slansing »

Sounds interesting... :). You will also need to make sure you get the return output from your scripts in a valid fashion "of course," also, if your scripts may take a bit longer to execute or return the session will need to be kept open so they don't get cut off, if that makes sense. Are you going to give nagios some more sudoers rules to run these ssh based check commands? "I've not personally tested this, you may not have to."
User avatar
BanditBBS
Posts: 2454
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Checking via SSH

Post by BanditBBS »

As of right now, I am just checking disk, CPU and ram. CPU check is just parsing data from iostat and disk is parsing data from df. The mem check is basically doing something similar, so special perms have not been needed yet.


edited for missing the word "not"
Last edited by BanditBBS on Thu Jan 02, 2014 11:39 am, edited 1 time in total.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Checking via SSH

Post by lmiltchev »

I haven't tested this either, but I am going to give it a try. BanditBBS, you never run out of ideas! :D
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked