Page 1 of 1
commands.cfg not getting updated
Posted: Thu Jul 22, 2021 8:54 am
by vishal313
Hi All,
I am trying to modify the content of commands.cfg under /usr/local/nagios/etc and add a command entry as below:
define command {
command_name check_xi_by_ssh
command_line $USER1$/check_by_ssh -t 30 -q -H $HOSTADDRESS$ $ARG1$ $ARG2$
}
After making the changes and saving the file, i run apply configuration. Once apply configuration is completed successfully the file doesnt reflect the changes which i do.
I tried doing the changes online, when Nagios services are up and running. I also tried to make changes after stopping Nagios Xi services. Nothing helps.
I also tried doing this change through Nagios UI but when i make changes to the command and save it, the page gets blank and after some time the "The website cannot display the page" error is displayed.
Please suggest.
Re: commands.cfg not getting updated
Posted: Thu Jul 22, 2021 10:33 am
by gsmith
Hi
Are you using Nagios or Nagios XI?
If XI, you should use Configure, Core Config Manager, then pick Commands from the left--hand pane.
There you can set up your command.
Either way, I suggest you create a new command rather than modifying the system
provided check_xi_by_ssh command.
Thanks
Re: commands.cfg not getting updated
Posted: Thu Jul 22, 2021 9:24 pm
by vishal313
Thank you for your response..
I am trying to modify the existing command to add the timeout value. I can create a new command successfully but motive here is to modify the existing command. I could do it on my other Nagios instances, it is just this particular instance is not accepting my request in some way.
Since we have done same changes on other instances of Nagios XI, I am expecting the same to be done on this one as well.
All my instances are on version : Nagios XI 5.8.3
Re: commands.cfg not getting updated
Posted: Fri Jul 23, 2021 9:03 am
by gsmith
Hi
Could you try going to Configure, Core Config Manager.
Then select Commands from the left-hand menu. Then search for check_xi_by_ssh
and modify it.
Thanks
Re: commands.cfg not getting updated
Posted: Sun Jul 25, 2021 11:11 pm
by vishal313
Thank you for your response again.
I did mention in my first message itself that i have tried changing the command from both server as well as GUI.
While doing it from GUI, i did go to Configure --> Core Config Manager --> Commands and tried changing the command, save it.
When i make changes to the command and save it, the page gets blank and after some time the "The website cannot display the page" error is displayed.
Re: commands.cfg not getting updated
Posted: Mon Jul 26, 2021 11:17 am
by gsmith
Hi,
I was able to change the command both ways on my test system. I am on 5.8.4 though.
What OS are you running on? I'd like to set up a system to match your OS and your 5.8.3 version
of XI?
Also please send me a System Profile so I can look at the logs.
To send us your system profile.
1. Login to the Nagios XI GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.
Thanks
Re: commands.cfg not getting updated
Posted: Tue Jul 27, 2021 8:13 am
by vishal313
Hi,
We have Nagios XI installed on Red Hat Enterprise Linux Server release 7.9 (Maipo).
I have shared the System Profile in private message. Please check and let me know if anything can help me.
Regards
Vishal Dhote
Re: commands.cfg not getting updated
Posted: Tue Jul 27, 2021 3:01 pm
by gsmith
Hi
I setup a machine running xi 5.8.3 on RHEL7.9 and I could not repeat the
error. However I do see some errors in the log files of your System Profile.
First, please check your diskspace as I am seeing:
(cannot update mailbox /var/mail/root for user root. error writing message: File too large)
Next - I suspect there are errors in the config before you made changes to commands.cfg, I see:
Code: Select all
Error: Could not find any host matching 'cespetslrla002' (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 57)
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 57)
Without modifying commands.cfg run "Apply Configuration" (Configure, Core Config Manager, Apply Configuration)
Fix any errors you find
It also looks like ncpd is terminating frequently:
Code: Select all
00343: [07-24-2021 02:25:03] NPCD: ERROR: Executed command exits with return code '7'
00344: [07-24-2021 02:25:03] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1627057479.perfdata.service'
Run the following commands and show the output in code wraps:
Code: Select all
ls /var/nagiosramdisk/spool/xidpe | wc -l
ls /var/nagiosramdisk/spool/perfdata/ | wc -l
ls /var/nagiosramdisk/spool/checkresults/ | wc -l
Also, run these and send me the output:
Code: Select all
lscpu
uptime
service npcd restart
service npcd status
tail -100 /usr/local/nagios/var/perfdata.log
Thanks
Re: commands.cfg not getting updated
Posted: Wed Jul 28, 2021 7:12 am
by vishal313
Hi,
The Apply configuration completes without any issues. No issue appears on the Nagios XI UI.
I have sent you the output for the commands you suggested on private message.
Not able to get to the reason why we are stuck in such situation.
Re: commands.cfg not getting updated
Posted: Wed Jul 28, 2021 10:30 am
by gsmith
Hi
IPlease increase the performance data processor's timeout range by editing:
/usr/local/nagios/etc/pnp/process_perfdata.cfg
Change:
TIMEOUT = 5
To:
TIMEOUT = 20
Then please send me the output of:
Code: Select all
tail -100 /usr/local/nagios/var/perfdata.log
Thanks