Syntax Command Check_netstat_conn
Re: Syntax Command Check_netstat_conn
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.
I think having a wrapper script run the 3 commands you're looking for should work.
Former Nagios Employee
Re: Syntax Command Check_netstat_conn
Can you login to the Nagios XI server, run the following and post the output?
Replace xxx.xxx.xxx.xxx with the IP address of the remote host.
Code: Select all
su nagios
/usr/local/nagios/libexec/check_by_ssh -H xxx.xxx.xxx.xxx -C "netstat -an |grep 5666| wc -l"Be sure to check out our Knowledgebase for helpful articles and solutions!
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
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
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
What is the output of the following command?
I set up a custom service, similar to yours and it seems to be working fine.
Code: Select all
grep nag /etc/groupYou do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
Hello Friend,
mine is equal to its setting, but it does not bring results. Below the image configuration.
mine is equal to its setting, but it does not bring results. Below the image configuration.
You do not have the required permissions to view the files attached to this post.
Re: Syntax Command Check_netstat_conn
Can you run the following command on the Nagios XI server, and show us the output?
Can you log in the remote box as nagios without password?
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'Code: Select all
su nagios
ssh nagios@remoteipBe sure to check out our Knowledgebase for helpful articles and solutions!
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
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.
You do not have the required permissions to view the files attached to this post.
Re: Syntax Command Check_netstat_conn
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?
Code: Select all
netstat -an |grep 5666| wc -lBe sure to check out our Knowledgebase for helpful articles and solutions!
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
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.
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.
You do not have the required permissions to view the files attached to this post.
Re: Syntax Command Check_netstat_conn
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.
Try that and let us know if this works for you.
The default service check timeout is causing the check to be terminated. This can be fixed by editing the nagios.cfg file.
Code: Select all
/usr/local/nagios/etc/nagios.cfgCode: Select all
service_check_timeout=60Code: Select all
time /usr/local/nagios/libexec/check_by_ssh -H <remote ip> -C "netstat -an | grep 5666 | wc -l"Be sure to check out our Knowledgebase for helpful articles and solutions!