Hi,
sometimes nagios.cmd looks with records not empty and the url submits does not run
Aby Idea
Pipe Hung
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Pipe Hung
Are you submitting command directly to nagios.cmd with scripts?
nagios.cmd is a command pipe that is created when nagios starts, however if a you have scripts that are writing to the location without first verifying the pipe exists, it could be creating the file which would be problematic.
If you are using bash for this it would be recommended to check for existence of the pipe ([ -p "$commandfile" ]) before writing to it such as
nagios.cmd is a command pipe that is created when nagios starts, however if a you have scripts that are writing to the location without first verifying the pipe exists, it could be creating the file which would be problematic.
If you are using bash for this it would be recommended to check for existence of the pipe ([ -p "$commandfile" ]) before writing to it such as
Code: Select all
#!/bin/sh
# 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.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
if [ -p "$commandfile" ]; then
/bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;host1;service1;0;OK- Great\n" $now > $commandfile
fi