check_by_ssh issue

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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_by_ssh issue

Post by slansing »

Have you tried any other commands relative to this protocol, such as NRPE? Do they display the same issues when being executed by nagios itself but work fine when su'd from the CLI?
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

Re: check_by_ssh issue

Post by yaoyao »

I use NRPE on global zones, but I only want to monitor a couple things on local zones, such as load, swap and processes. I think that ssh would work just fine. I dont want to install another piece if I dont need to. It is just weird: command line works fine, but not from core. It should be a simple fix, but I just don't know what it is.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_by_ssh issue

Post by slansing »

We are asking this.. because we need to know how these other commands react in Solaris 10, which is an unsupported operation system for core installations.
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

Re: check_by_ssh issue

Post by yaoyao »

So far, I only have issues with check_by_ssh from core.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_by_ssh issue

Post by abrist »

Just out of curiosity, what if you wrap check_by_ssh in a script and call that script from nagios, does it work?
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.
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

Re: check_by_ssh issue

Post by yaoyao »

How do you wrap it properly for nagios? I would think there is nothing wrong with chech_by_ssh itself, otherwise, I would get error when I ran it manually from the command line.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_by_ssh issue

Post by abrist »

Code: Select all

#!/bin/bash
CHECK=$(/usr/local/nagios/check_by_ssh -H terra -C "/usr/local/nagios/libexec/check_load -w 8.0,8.0,8.0 -c 16.0,16.0,16.0")
echo $CHECK
exit 0
This will always return OK, it was just a test to see if calling a script through the shell would bypass the linking issues. If it works you should get the output as if you ran it from teh cli. If it does not , you should still see errors. Use this script for the check and let us know.
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.
yaoyao
Posts: 17
Joined: Fri Jul 05, 2013 3:14 pm

Re: check_by_ssh issue

Post by yaoyao »

I installed CSW nagios plugins package. I used check_by_ssh from that package and link /usr/bin/ssh to /opt/csw/bin/ssh and everything is working now.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_by_ssh issue

Post by abrist »

yaoyao wrote:I installed CSW nagios plugins package.
Great. Good to know. You may want to check CSW first for future packages as that community is very good at resolving dependency/linking problems. Cheers.
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.
Locked