Syntax Command Check_netstat_conn
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
I already created a Nagios user on the remote machine. Below them as they are the permissions of files and SSH or file that I want to run on the remote machine.
You do not have the required permissions to view the files attached to this post.
Re: Syntax Command Check_netstat_conn
I ran into a similar issue when I tested this. From the .ssh folder, run chown nagios:nagios . - this should fix it.
Also - just to verify - did you set a password for the nagios user on the remote machine?
Let me know the result.
Also - just to verify - did you set a password for the nagios user on the remote machine?
Let me know the result.
Former Nagios Employee
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
Good morning mate!
I did the following step-by-step.
I created a Nagios user on the remote machine and set a password for it.
I could not carry out the execution of the command
"Ssh-copy-id ~ / .ssh / id_rsa.pub [email protected]" because the result of this command is as follows:
ssh: Could not resolve hostname /home/nagios/.ssh/id_rsa.pub: Temporary failure in name resolution
So I copied via scp to id_rsa key, id_rsa.pub to the remote machine.
Since then I can not connect via ssh Nagios (10.10.60.51) to the remote host (10.10.60.52) with Nagios user of the remote machine.
However I can not perform the check via check_by_ssh, reports the following message.
Critical - plugin time out after 10 seconds
[email protected]'s password:
[email protected]'s password:
Note: I already realized chown nagios: nagios /home/nagios/.ssh
and also in the file.
is to solve this friend? Help me.
I did the following step-by-step.
I created a Nagios user on the remote machine and set a password for it.
I could not carry out the execution of the command
"Ssh-copy-id ~ / .ssh / id_rsa.pub [email protected]" because the result of this command is as follows:
ssh: Could not resolve hostname /home/nagios/.ssh/id_rsa.pub: Temporary failure in name resolution
So I copied via scp to id_rsa key, id_rsa.pub to the remote machine.
Since then I can not connect via ssh Nagios (10.10.60.51) to the remote host (10.10.60.52) with Nagios user of the remote machine.
However I can not perform the check via check_by_ssh, reports the following message.
Critical - plugin time out after 10 seconds
[email protected]'s password:
[email protected]'s password:
Note: I already realized chown nagios: nagios /home/nagios/.ssh
and also in the file.
is to solve this friend? Help me.
Re: Syntax Command Check_netstat_conn
Here's what I did:
1. Copied the "check_netstat_conn.sh" script to the "/usr/local/nagios/libexec/" directory on the remote box.
2. Copied the public key from my XI box to the remote machine as "authorized_keys".
3. Made sure the permissions of the files in the "/home/nagios/.ssh" directory on the remote machine are correct. Here's what I have:
4. Tested the passwordless log in to the remote machine from the Nagios XI server.
Hope this helps.
1. Copied the "check_netstat_conn.sh" script to the "/usr/local/nagios/libexec/" directory on the remote box.
2. Copied the public key from my XI box to the remote machine as "authorized_keys".
Code: Select all
scp id_rsa.pub [email protected]:/home/nagios/.ssh/authorized_keysCode: Select all
ls -la /home/nagios/.ssh
total 20
dr-xr-xr-x 2 nagios nagios 4096 Mar 11 10:30 .
dr-xr-xr-x. 5 nagios nagios 4096 Nov 9 11:30 ..
-rw------- 1 nagios users 410 Mar 11 10:30 authorized_keys
-rw------- 1 nagios users 1671 Nov 9 11:30 id_rsa
-rw-r--r-- 1 nagios users 410 Nov 9 11:30 id_rsa.pubCode: Select all
su nagios
[nagios@localhost root]$ ssh [email protected]
Last login: Fri Mar 11 10:35:20 2016 from y.y.y.y
[nagios@localhost root]$ /usr/local/nagios/libexec/check_by_ssh -H x.x.x.x -C "/usr/local/nagios/libexec/check_netstat_conn.sh"
OK: 5|count=5
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
Then the nagios user sets the remote machine is no password?
Re: Syntax Command Check_netstat_conn
The Nagios user will be logged in without being prompted for a password. This is typically referred to as key-based auth. https://www.digitalocean.com/community/ ... nux-serverThen the nagios user sets the remote machine is no password?
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
Good morning friends!
I managed to perform SSH connection without password with Nagios User.
Now when I run the plugin / usr / local / nagios / libexec / check_by_ssh - H 10.10.60.52 -C "command" the following message appears.
CRITICAL - Plugin timed out after 10 seconds
what's up?
I managed to perform SSH connection without password with Nagios User.
Now when I run the plugin / usr / local / nagios / libexec / check_by_ssh - H 10.10.60.52 -C "command" the following message appears.
CRITICAL - Plugin timed out after 10 seconds
what's up?
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
Updating, I managed to perform the verification via ssh, as in the picture attached. However I just can it starting CLI, when I set up the command in NagiosXI it returns me the following error.
NagiosXI
COMMAND: /usr/local/nagios/libexec/check_by_ssh -H 10.10.60.52 -C "/usr/local/nagios/libexec/check_users -w 5 -c 10" -t 120
OUTPUT: Remote command execution failed: Could not create directory '/var/www/.ssh'.
NagiosXI
COMMAND: /usr/local/nagios/libexec/check_by_ssh -H 10.10.60.52 -C "/usr/local/nagios/libexec/check_users -w 5 -c 10" -t 120
OUTPUT: Remote command execution failed: Could not create directory '/var/www/.ssh'.
You do not have the required permissions to view the files attached to this post.
Re: Syntax Command Check_netstat_conn
Just to clarify - is this from the test check command? What is the actual result in the Nagios interface?NagiosXI
COMMAND: /usr/local/nagios/libexec/check_by_ssh -H 10.10.60.52 -C "/usr/local/nagios/libexec/check_users -w 5 -c 10" -t 120
OUTPUT: Remote command execution failed: Could not create directory '/var/www/.ssh'.
Looks like we're making progress!
Former Nagios Employee
-
ednaldojta
- Posts: 103
- Joined: Tue Apr 07, 2015 7:52 am
Re: Syntax Command Check_netstat_conn
HEHH: D
but we are making progress, and I appreciate until the time for help.
Regarding the results in Nagios screen. Appears the following mensagem.Segue screen attached.
Here also as is the configuration of the Nagios configuration in wizards.
but we are making progress, and I appreciate until the time for help.
Regarding the results in Nagios screen. Appears the following mensagem.Segue screen attached.
Here also as is the configuration of the Nagios configuration in wizards.
You do not have the required permissions to view the files attached to this post.