One or more scheduled commands could not be sent to Nagios C

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

One or more scheduled commands could not be sent to Nagios C

Post by jsalsbury »

Good morning
We are running into this issue again after our most recent upgrade.
One or more scheduled commands could not be sent to Nagios Core.

I also tried to pull my profile. I got this error message.

PROFILE BUILD FAILED
Array
(
)
CODE: 1
Last edited by jsalsbury on Thu Jan 02, 2020 2:22 pm, edited 1 time in total.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by lmiltchev »

One or more scheduled commands could not be sent to Nagios Core.
Can you give us a little bit more details on that? What command are you sending to Nagios Core? What is the error that you are seeing in the GUI? A screenshot would be helpful.

As far as the profile issues goes, please follow the steps, outlined in the KB article below:

https://support.nagios.com/kb/article/n ... d-533.html

Let us know if this fixed the issue for you. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by jsalsbury »

Hello, Happy New year, thanks in advance for the help.

I was trying to schedule downtime from the home screen.

I attempted to run the commands and had an issue with the CAT portion


root@peplap02192:~# cd tmp/
root@peplap02192:~/tmp# tar xzf xi-5.6.3.tar.gz nagiosxi/nagiosxi/nagiosxi.sudoers --strip-components 2
root@peplap02192:~/tmp# grep -v NAGIOSXI /etc/sudoers > /etc/sudoers.new
root@peplap02192:~/tmp# mv -f /etc/sudoers.new /etc/sudoers
root@peplap02192:~/tmp# rm -rf /etc/sudoers.d/nagiosxi
root@peplap02192:~/tmp# sed -i 's/^Defaults requiretty/#Defaults requiretty/g' /etc/sudoers
root@peplap02192:~/tmp# cat /tmp/nagiosxi.sudoers >> /etc/sudoers
cat: /tmp/nagiosxi.sudoers: No such file or directory
root@peplap02192:~/tmp# chmod 440 /etc/sudoers
root@peplap02192:~/tmp# cd ..
root@peplap02192:~# cd etc
-bash: cd: etc: No such file or directory

root@peplap02192:~# ls
all_hosts.txt IEM3
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by lmiltchev »

Hello, Happy New year, thanks in advance for the help.
Thanks! Happy New year to you too!
I was trying to schedule downtime from the home screen.
What is the error that you see in the GUI? Screenshot?

Run the following commands and show the output:

Code: Select all

chage -l nagios 
chage -l apache
grep nag /etc/group
cat: /tmp/nagiosxi.sudoers: No such file or directory
This is strange. The command below, should've extracted the "nagiosxi.sudoers" file:

Code: Select all

tar xzf xi-5.6.3.tar.gz nagiosxi/nagiosxi/nagiosxi.sudoers --strip-components 2
Can you list the file in your /tmp directory?

Code: Select all

cd /tmp
ls -la
Be sure to check out our Knowledgebase for helpful articles and solutions!
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by jsalsbury »

root@peplap02192:~/tmp# chage -l nagios
Last password change : Oct 25, 2016
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
root@peplap02192:~/tmp# chage -l apache
Last password change : Oct 24, 2016
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1
root@peplap02192:~/tmp# grep nag /etc/group
nagiosse:x:43899:
splunkse:x:43628:nagiosse,splunkse
apache:x:48:nagios,snmptt
nagios:x:40601:nagios,snmptt,apache
nagcmd:x:43900:snmptt
snmptt:x:986:nagios


total 56512
drwxr-x--- 2 root root 4096 Jan 2 13:12 .
dr-xr-x---. 20 root root 4096 Dec 16 14:48 ..
-r--r--r-- 1 root root 2 Mar 21 2017 disable~
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.chkconfig
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.crontabs
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.dbbackups
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.dbservers
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.firewall
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.mrtg
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.mysql
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.nagiosxi
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.phplimits
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.prereqs
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.repos
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.selinux
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.services
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.sourceguardian
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.subcomponents
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.sudoers
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.timezone
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.usersgroups
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.xidb
-rw-r--r-- 1 root root 2054 Jun 10 2019 nagiosxi.sudoers
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by lmiltchev »

This doesn't seem like a "clean" (vanilla) system. You have some "custom" entries in the /etc/group file, e.g. nagiosse and splunkse... Also, your nagcmd group doesn't have nagios and apache added to it. Most likely, this is why you are not able to submit commands. Open the /etc/group in a text editor, and change this:

Code: Select all

nagcmd:x:43900:snmptt
to this:

Code: Select all

nagcmd:x:43900:nagios,apache,snmptt
Since you didn't show us the actual commands that you run when listing the directory (just showed the output), I am not sure what directory you were in... Were you in /tmp when you run "ls -la"? Is this the entire output? I see three issues with this output:

1. The "installed.xxx" files should not be in the /tmp directory, but in /tmp/nagiosxi...
2. The "xi-5.6.3.tar.gz" file is missing.
3. The "nagiosxi.sudoers" is present, but you cannot cat it?!
root@peplap02192:~/tmp# cat /tmp/nagiosxi.sudoers >> /etc/sudoers
cat: /tmp/nagiosxi.sudoers: No such file or directory
Can you double-check the paths and the files in /tmp? You may try removing all files from the /tmp directory, and rerunning the commands, listed in our KB article - https://support.nagios.com/kb/article/n ... d-533.html on the topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by jsalsbury »

The files are where they should be, looks like I just did a bad copy and paste

root@peplap02192:~/tmp# ls -la
total 56512
drwxr-x--- 2 root root 4096 Jan 2 13:12 .
dr-xr-x---. 20 root root 4096 Dec 16 14:48 ..
-r--r--r-- 1 root root 2 Mar 21 2017 disable~
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.chkconfig
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.crontabs
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.dbbackups
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.dbservers
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.firewall
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.mrtg
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.mysql
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.nagiosxi
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.phplimits
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.prereqs
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.repos
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.selinux
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.services
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.sourceguardian
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.subcomponents
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.sudoers
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.timezone
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.usersgroups
-rw-r--r-- 1 root root 0 Oct 25 2016 installed.xidb
-rw-r--r-- 1 root root 2054 Jun 10 2019 nagiosxi.sudoers
-rw-r----- 1 root root 57847979 Jun 10 2019 xi-5.6.3.tar.gz
root@peplap02192:~/tmp#
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by jsalsbury »

I do not seem to have a sudoers folder under nagios etc

root@peplap02192:~/nagios-xi/etc# ls
yum.repos.d
root@peplap02192:~/nagios-xi/etc# ls
yum.repos.d
root@peplap02192:~/nagios-xi/etc#
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by lmiltchev »

Your sudoers should be in "/etc/sudoers", NOT in "/root/nagios-xi/etc". Have you modified your system from the "default", e.g. using custom paths, etc.?

Can you post your sudoers file?

Code: Select all

cat /etc/sudoers
Be sure to check out our Knowledgebase for helpful articles and solutions!
jsalsbury
Posts: 87
Joined: Tue Oct 23, 2018 12:57 pm

Re: One or more scheduled commands could not be sent to Nagi

Post by jsalsbury »

No special pathing was implemented to my knowledge. We did have this issue in the past perhaps it is logged somewhere in my last ticket?

Attached is my sudo file
You do not have the required permissions to view the files attached to this post.
Locked