Hm, well this is interesting. Yes, I was running it on root, and this is probably a problem, if not the problem. The weird thing is that when I do su - nagios on my nagios server and try to ssh to an account (I called it nagios, too) on the other machine, it prompts me for a password even though I don't have the account password protected. This would definitely be a block to Nagios when it tried to do it automatically. Now, the question is, why is it asking my for a password? I set up an RSA key and copied it to the authorized_keys file on the second machine and I'm pretty sure I did that properly.sreinhardt wrote:When you are doing this via cli, are you running as root or the nagios user? You very possibly need to do this as the nagios user, or accept the ssh key as the nagios user via a manual ssh over first. Otherwise the plugin will just fail. However the 255 out of bounds is still a bit strange.
Web interface Error:Could not read object configuration data
Re: Web interface Error:Could not read object configuration
Re: Web interface Error:Could not read object configuration
Try logging in as root, and then su'ing over to the user nagios. root should be able to su to any user . . .
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.
"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.
Re: Web interface Error:Could not read object configuration
I can su to nagios, but after that when I'm trying to ssh an un-passworded account on another machine, it asks me for a password anyway. That's what I don't get; I can access the nagios account on the server just fine.abrist wrote:Try logging in as root, and then su'ing over to the user nagios. root should be able to su to any user . . .
Re: Web interface Error:Could not read object configuration
I am now sure what is causing that, but I would recommend re-generating the keys:
On the nagios server, run:
Press "Enter" and accept defaults (don't enter a password). Public and private SSH keys will be generated and saved in: "/home/nagios/.ssh".
On the remote box, run:
Press "Enter" and accept defaults (don't enter a password).
Go back to the nagios server, and copy the public key of the nagios user on the nagios server to the authorized_keys for the nagios user on the remote box.
Make sure, the permissions are correct - you should have something like this:
Verify that you can login to the remote server without supplying a password by suing the following commands on the nagios server:
where you replace <remote_IP> with the IP addres of the remote linux server.
After you verified you could log in without password, try running your check again.
On the nagios server, run:
Code: Select all
su nagios
ssh-keygenOn the remote box, run:
Code: Select all
su nagios
ssh-keygenGo back to the nagios server, and copy the public key of the nagios user on the nagios server to the authorized_keys for the nagios user on the remote box.
Make sure, the permissions are correct - you should have something like this:
Code: Select all
[nagios@localhost .ssh]$ ls -al
total 24
drwx------ 2 nagios users 4096 Jul 16 09:44 .
drwx------ 3 nagios users 4096 Jul 16 09:43 ..
-rw------- 1 nagios users 410 Jul 16 09:44 authorized_keys
-rw------- 1 nagios users 1675 Jul 16 09:43 id_rsa
-rw-r--r-- 1 nagios users 410 Jul 16 09:43 id_rsa.pubCode: Select all
su nagios
ssh nagios@<remote_IP>After you verified you could log in without password, try running your check again.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Web interface Error:Could not read object configuration
Nope, will not connect. It just keeps asking for a password, even though the nagios account doesn't even have a password. I set up a working SSH between two other VMs just the other day, so I don't know why it's acting any differently here. That's definitely the problem.
Re: Web interface Error:Could not read object configuration
If it is asking for your password, the keys are probably not in the right place.
What is the output of:
Run this on both the nagios server and remote host.
What is the output of:
Code: Select all
ls -la /home/nagios/.sshFormer 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.
"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.
Re: Web interface Error:Could not read object configuration
On the server, it's:abrist wrote:If it is asking for your password, the keys are probably not in the right place.
What is the output of:Run this on both the nagios server and remote host.Code: Select all
ls -la /home/nagios/.ssh
Code: Select all
drwx------ 2 nagios nagios 4096 Aug 19 14:13 .
drwx------ 3 nagios nagios 4096 Aug 19 14:04 ..
-rw------- 1 nagios nagios 1675 Aug 19 14:11 id_rsa
-rw-r--r-- 1 nagios nagios 414 Aug 19 14:11 id_rsa.pub
-rw-r--r-- 1 nagios nagios 409 Aug 19 14:08 known_hosts
Code: Select all
drwxrwxr-x 2 nagios nagios 4096 Aug 19 10:12 .
drwx------ 3 nagios nagios 4096 Aug 19 10:09 ..
-rw-rw-r-- 1 nagios nagios 415 Aug 19 10:12 authorized_keys
-rw------- 1 nagios nagios 1675 Aug 19 10:11 id_rsa
-rw-r--r-- 1 nagios nagios 415 Aug 19 10:11 id_rsa.pub
Re: Web interface Error:Could not read object configuration
What is in the "authorized_keys" directory on the remote host?
Do you have any restrictions setup on the "nagios" account on the remote system?
Code: Select all
ls -la /home/nagios/.ssh/authorized_keys Code: Select all
grep nagios /etc/shadowFormer 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.
"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.
Re: Web interface Error:Could not read object configuration
Are you sure that you copied the public key of the nagios user on the nagios server to the authorized_keys for the nagios user on the remote box?
Open both files in a text editor:
on the nagios server: /home/nagios/.ssh/id_rsa.pub
on the remote box: /home/nagios/.ssh/authorized_keys
and compare them. They should be identical.
Open both files in a text editor:
on the nagios server: /home/nagios/.ssh/id_rsa.pub
on the remote box: /home/nagios/.ssh/authorized_keys
and compare them. They should be identical.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Web interface Error:Could not read object configuration
It's not a directory, it's a file containing the server's public key. It reads:abrist wrote:What is in the "authorized_keys" directory on the remote host?Code: Select all
ls -la /home/nagios/.ssh/authorized_keys
Code: Select all
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA8PkNpfoe+QXEuD4MEt/pS7Jri4e5sYjwUDmCAIIioaPj7mACS/MhD3EAQ3l01qOaBjvE1cubZOzDDmYnvlAGmeqtPynZSCITUykQcaT9xPXTei3Lk9QOnW5On+v5/UhoMjGiV+q65sPVOLCpT/Rj/RkL+cau+tAnRE1MMWpyME/0EZM3w0+MCV7zB5lOiRdb5VLKcCHlzUZ5mU+aXH4nyeM3tOgvWvz+dZmGo3ki7SAMf599Ypmea6lWLPl3XKvSZGLAowzmDhXrRtpf2u9SC3hpRbbujTzSjLORj3Rr4mGnAvuyUQK81/iI20HqH/RMTKuiK0O2168yOHuyJ05hTQ== nagios@nagiostest03.*censoreddomainname*.com
It's the same text as the id_rsa.pub file on the server, which also answers lmiltchev's question. Yes, they are indeed identical.