On my Nagios server, I am running:
socat -u TCP-LISTEN:5668,fork EXEC:/usr/local/bin/process_remote_command
(socat is like netcat on steroids, a very useful thing)
process_remote_command is a basic filter that currently drops all lines not containing SCHEDULE_HOST_DOWNTIME. It expects an external command in the proper forward then prints it to the command file.
On a host, I run:
echo "$COMMAND;$HOST;$START;$END;$FIXED;$TRIGGER;$DURATION;$AUTHOR;$COMMENT" | socat -u STDIN TCP:nagiosserver:5668
What this allows me to do is add a downtime remotely. If I have a server that is set to reboot nightly via a cron, I can add commands to that cronjob script to automatically schedule downtime for that host.
Thoughts on this? Is there a better way?