Page 4 of 5

Re: could not fetch information from server

Posted: Tue Aug 01, 2017 9:56 am
by lmiltchev
Yes, we received the "tar.gz" file and I confirmed it: "We received the info that you PM-ed us, and will be looking into it..." See my post from Mon Jul 31, 2017 8:32 am.

There was nothing out of ordinary in the commands.cfg file in regards to the error shown in the GUI ("Command name of command line is NULL... starting on line 486"). This led us to believe this is a permissions issue. That's why we wanted to see the sudoers file.

You haven't showed us the entire sudoers file though. We need to verify if you have the following line in it:

Code: Select all

Defaults:nagios !requiretty
Can you run:

Code: Select all

grep requiretty /etc/sudoers
and show the output?

Go to the CCM > Tools > Config File Management, and click on "Delete Files", "Write Configs", and "Verify Files" in the exact same order, showing a screenshot of the page after each click. If you don't see any configuration errors after clicking on these buttons, you can apply configuration. If you see errors, post them on the forum, and PM me your profile (profile.zip)

Admin > System Profile > Download Profile

Re: could not fetch information from server

Posted: Tue Aug 01, 2017 10:06 am
by tgriep
Are you having the Apply Configuration error or the Could Not Fetch error or both?
The entries in the sudoers files look correct but if we could see the whole file, that would be better.

I did receive the System Profile but some of the permissions still doesn't look right.
It could be a umask issue or a mis-configured group etc....
So can you login to the XI server as root, run the following commands and post the output.

Code: Select all

chage -l nagios
chage -l apache
grep nag /etc/passwd
grep nag /etc/group
su - nagios
umask

Re: could not fetch information from server

Posted: Wed Aug 02, 2017 8:29 am
by michelk
good day as requested i have sent the profile in PM

you said the sudoers file was not received am attaching it here again
i have tgried to run the following grep requiretty /etc/sudoers and there was no output
as for the config file when click on delete and write the error is also attached

please find attached the output after running the folowing: i have inserted sudo before each
chage -l nagios
chage -l apache
grep nag /etc/passwd
grep nag /etc/group
su - nagios
umask

please if any other thing needed please give me the scripts i will run it and give you the output

thank you again for your hnelp

Re: could not fetch information from server

Posted: Wed Aug 02, 2017 8:30 am
by michelk
umask

Re: could not fetch information from server

Posted: Wed Aug 02, 2017 10:48 am
by tgriep
It looks like the system wide umask settings was changes and that is causing the permissions issue.
Either change the system wide umask back to 0022 or you can edit the nagios init script and set it there.

If you want to just change the nagios init script, you would edit the following file

Code: Select all

/etc/init.d/nagios
and add the following to the script

Code: Select all

umask 022
Put it around line 173 under this line that contains
start)

Save the file and restart nagios by running

Code: Select all

service nagios restart
Then run the following to fix the permissions of the files.

Code: Select all

chmod ug+rw /usr/local/nagios/etc/*.cfg

Then to test to see if that fixes the issue, run the following and post the output.

Code: Select all

cd /usr/local/nagiosxi/scripts
su - nagios
./reconfigure_nagios.sh
It it passes, try running the Apply Config in the GUI.
Any errors, post them here.

Re: could not fetch information from server

Posted: Thu Aug 03, 2017 4:48 am
by michelk
gooday,

i have tried to follow the instructions and have change the umask to 0022 as requested
didn't really get what yo meant by (Put it around line 173 under this line that contains start) but i followed all the scripts you gave me one by one
and please find attached the steps and the output till when i run chmod ug+rw /usr/local/nagios/etc/*.cfg

and it's seems like i do hame a permission issue

i also tried to run the last step and see
cd /usr/local/nagiosxi/scripts
su - nagios
./reconfigure_nagios.sh

when running su - nagios it's request for a password that i don't have i d not remember configuring a password and even when password are requested i always have about 3 0password in mind that i never changed tried them all still nothing but am quiet sure that i did not configure a password

and when i try to run the last line here is the output attached for ./reconfigure_nagios.sh
looking forward to here from you as my issue still unreasolved

Re: could not fetch information from server

Posted: Thu Aug 03, 2017 7:36 am
by michelk
any update?

Re: could not fetch information from server

Posted: Thu Aug 03, 2017 3:46 pm
by tgriep
The nagios account cannot have a password and it cannot be set to expire so I thing that is the issue you are having.
To fix that, run the following as root.
Login as root and run the following to fix the issue.

Code: Select all

passwd --delete nagios
chage -I -1 -m 0 -M 99999 -E -1 nagios
Then lets reset all of the permissions manually by running the following

Code: Select all

chown -R nagios.nagios /usr/local/nagios/etc
chmod -R 775 /usr/local/nagios/etc
chown -R nagios.nagios /usr/local/nagiosxi/nom
chmod -R 775 /usr/local/nagiosxi/nom
Let us know it this fixes the issue.

Re: could not fetch information from server

Posted: Fri Aug 04, 2017 3:19 am
by michelk
hi,

thank you for replying i have tried to do what you asked can you double check it if i did miss something? if yes please advise.
to my observation it's looks like there is two more error added on the config file management when i click on delete then write i got the same two error : Error: Command name of command line is NULL
Error: Could not register command (config file '/usr/local/nagios/etc/commands.cfg', starting on line 486)

but if i do the same and stop at delete than verify i have 2 more if you may have a look at it as well

please find attached the two screenchot when i run the scripts you gave me see if i did it the right wat and then try to checck the config manag error as well

Re: could not fetch information from server

Posted: Fri Aug 04, 2017 12:07 pm
by tgriep
PM was received and we'll get back to you next week.