Page 3 of 5
Re: Syntax Command Check_netstat_conn
Posted: Fri Mar 18, 2016 2:41 pm
by rkennedy
I don't know how well it'll handle the |, can you create a one line bash script to do this on the remote machine, grant nagios permissions to run the file, and then try again?
I think having a wrapper script run the 3 commands you're looking for should work.
Re: Syntax Command Check_netstat_conn
Posted: Fri Mar 18, 2016 2:43 pm
by tgriep
Can you login to the Nagios XI server, run the following and post the output?
Code: Select all
su nagios
/usr/local/nagios/libexec/check_by_ssh -H xxx.xxx.xxx.xxx -C "netstat -an |grep 5666| wc -l"
Replace xxx.xxx.xxx.xxx with the IP address of the remote host.
Re: Syntax Command Check_netstat_conn
Posted: Fri Mar 18, 2016 2:48 pm
by ednaldojta
Kennedy I did not understand well, the fact is that the command looks like this with an estimated time of 60 seconds if the scan is not performed at this time, there's the time exhausted. Sera's that?
tgriep
the command line I can get the result I want. But Nagios dashboard I can not, of this message I posted in the previous post.
su nagios
[nagios@MFE-PROD-REL01 $]/usr/local/nagios/libexec/check_by_ssh -H 10.10.60.52 -C "netstat -an |grep 5666| wc -l" -t 120
1
Re: Syntax Command Check_netstat_conn
Posted: Fri Mar 18, 2016 3:09 pm
by lmiltchev
What is the output of the following command?
I set up a custom service, similar to yours and it seems to be working fine.
example01.PNG
example02.PNG
Re: Syntax Command Check_netstat_conn
Posted: Mon Mar 21, 2016 6:28 am
by ednaldojta
Hello Friend,
mine is equal to its setting, but it does not bring results. Below the image configuration.
Re: Syntax Command Check_netstat_conn
Posted: Mon Mar 21, 2016 1:38 pm
by lmiltchev
Can you run the following command on the Nagios XI server, and show us the output?
Code: Select all
su -l nagios -c '/usr/local/nagios/libexec/check_by_ssh -H <remote ip> -C "netstat -an | grep 5666 | wc -l" -t 120'
Can you log in the remote box as nagios without password?
Re: Syntax Command Check_netstat_conn
Posted: Mon Mar 21, 2016 2:01 pm
by ednaldojta
Yes! I can access without password! Ja configured certificates! So I can not bring results starting the graphical interface NagiosXI. Below is the output of the commands.
Re: Syntax Command Check_netstat_conn
Posted: Mon Mar 21, 2016 5:01 pm
by tgriep
Can you login to the remote system as the nagios user and run the commands?
Are there any errors in the log files in /var/log on the remote system?
Re: Syntax Command Check_netstat_conn
Posted: Tue Mar 22, 2016 6:39 am
by ednaldojta
Griep,
I can access and bring all through the CLI results, which I can not bring it is starting the graphical interface of Nagios XI (Dashboards). I can carry out the command via SSH and locally on the remote machine.
You know what might be acontencendo, all the steps that you asked me now, since I made earlier.
Attached requested.
Ha, I do not know if it can help. But when I connect via SSH on the remote machine, it costs more than a minute to connect or bring results via SSH.
Re: Syntax Command Check_netstat_conn
Posted: Tue Mar 22, 2016 2:42 pm
by tgriep
Thanks for the info.
The default service check timeout is causing the check to be terminated. This can be fixed by editing the nagios.cfg file.
and increasing this value to a larger number so it will not timeout.
One way to find out how long the command takes it to add the time command. This will ell you how lond it ran and you can use that for the above settings.
Code: Select all
time /usr/local/nagios/libexec/check_by_ssh -H <remote ip> -C "netstat -an | grep 5666 | wc -l"
Try that and let us know if this works for you.