#!/bin/bash
# This is a sample shell script showing how you can submit the PROCESS_SERVICE_CHECK_RESULT command
# to Nagios. Adjust variables to fit your environment as necessary.
HOSTNAME=$1
SERVICENAME=$2
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/usr/bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;$HOSTNAME;$SERVICENAME;0;OK - Manual Reset\n" $now > $commandfile
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.
Indeed, it's working now. Is there a way to prevent the webpage from popping up that is only saying the script is running? We would really just want to the script to execute silently (in the background).
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.
I made the changes you asked and did a service httpd restart, flushed cache, but it's not working yet. Attached some screenshots. Anything else I'm supposed to do? I made a backup first and had to put the $cbargs line with two enters to get it in the screenshot, but it's still in one line in the file..
You do not have the required permissions to view the files attached to this post.
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.
PHP Warning: Missing argument 3 for actions_component_get_service_vars(), called in /usr/local/nagiosxi/html/includes/components/actions/runcmd.php on line 100 and defined in /usr/local/nagiosxi/html/includes/components/actions/actions.inc.php on line 685, referer: http://srvnagios01/nagiosxi/includes/co ... &dest=auto
PHP Warning: Missing argument 4 for actions_component_get_service_vars(), called in /usr/local/nagiosxi/html/includes/components/actions/runcmd.php on line 100 and defined in /usr/local/nagiosxi/html/includes/components/actions/actions.inc.php on line 685, referer: http://srvnagios01/nagiosxi/includes/co ... &dest=auto
The options from the component are not getting passed to the php correctly. This is strange as what I had you change would not effect that at all. What does your actions component configuration for the action look like? (screenshot?)
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.
I'm still testing, so I have one action for nrdp, one with the external command interface (web) and one with bash script. See screenshot:
I only tested the bash script action, so the error log comes from the 4th action.
You do not have the required permissions to view the files attached to this post.
Was the exact configuration working before my php edits?
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.