API: Could not open command file
Posted: Wed Aug 08, 2018 8:37 am
Hi
When I try to execute a system command through the API I get
When I try to execute a system command through the API I get
Nagios 5.5.2# curl -XPOST "https://nagios/nagiosxi/api/v1/system/c ... ikey=mykey" -d "cmd=ADD_HOST_COMMENT;localhost;1;%user%;This is a test comment"
{"error":"ERROR: Could not open command file"}
Code: Select all
# ls -al /usr/local/nagios/var/rw
total 8
drwsr-xr-x. 2 nagios nagios 64 Aug 8 14:53 .
drwxrwxr-x. 6 nagios nagios 4096 Aug 8 15:35 ..
prw-rw----. 1 nagios nagios 0 Aug 8 14:53 nagios.cmd
-rw-r-----. 1 nagios nagios 4096 Dec 8 2015 .nagios.cmd.swp
srw-rw----. 1 nagios nagios 0 Aug 8 14:53 nagios.qhCode: Select all
apache 416 20078 0 15:34 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 2149 20078 0 15:35 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 3067 20078 1 15:35 ? 00:00:04 /usr/sbin/httpd -DFOREGROUND
apache 4771 20078 0 15:02 ? 00:00:09 /usr/sbin/httpd -DFOREGROUND
apache 5033 20078 0 15:36 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 6759 20078 0 15:37 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 8549 20078 0 15:38 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root 10356 13104 0 15:39 pts/0 00:00:00 grep --color=auto http
root 20078 1 0 14:53 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 27396 20078 0 15:31 ? 00:00:02 /usr/sbin/httpd -DFOREGROUND
apache 28987 20078 0 15:32 ? 00:00:01 /usr/sbin/httpd -DFOREGROUND
apache 29871 20078 0 15:33 ? 00:00:02 /usr/sbin/httpd -DFOREGROUNDCode: Select all
# grep nagios /etc/group
nagios:x:994:apache,nagios,snmptt
nagcmd:x:2002:apache,nagios,snmptt