Introduction
- The CommandFragment element is used
CommandFragment
Examples
Nagios / op5
The following is an excerpt from an XML configuration for notification with passive checks for the Nagios® and op5® System Monitors using CommandFragment.
Nagios / op5 Example
... <!-- service_host The host that executes the passive check. The name must match the corresponding setting in the System Monitor. monitor_host The hostname or IP address of System Monitor host. service_status 0=success, 1=warning, 2=critical ${MON_O_CONTROLLER_ID} The JS7 Controller ID, see Monitor Variables ... Message example after substitution (error case): <Message name="notify_on_error"><![CDATA["localhost\tJS7 Monitoring Errors\t2\tERROR controller id=jobscheduler, history id=123, workflow path=test/some_workflow, label=100, error=error occurred\n"]]></Message> Message example after substitution (recovery case): <Message name="notify_on_error"><![CDATA["localhost\tJS7 Monitoring Errors\t0\tRECOVERED controller id=jobscheduler, history id=123, workflow path=test/some_workflow, label=100, error=error occurred\n"]]></Message> Message example after substitution (success case): <Message name="notify_on_error"><![CDATA["localhost\tJS7 Monitoring Success\t0\tSUCCESS controller id=jobscheduler, history id=123, workflow path=test/some_workflow, label=100, error=\n"]]></Message> --> ... <Message name="notify_on_error"><![CDATA["service_host\tJS7 Monitoring Errors\t2\t${MON_OS_SEVERITY} controller id=${MON_O_CONTROLLER_ID}, history id=${MON_O_HISTORY_ID}, workflow path=${MON_O_WORKFLOW_PATH}, order id=${MON_O_ORDER_ID}, status=${MON_OS_SEVERITY}, error=${MON_OS_ERROR_TEXT}\n"]]></Message> ... <CommandFragment name="command_on_error"> <MessageRef ref="notify_on_error"/> <Command><![CDATA[echo -e ${MESSAGE} | /usr/local/nagios/bin/send_nsca -H monitor_host -c /usr/local/nagios/etc/send_nsca.cfg]]></Command> </CommandFragment> ...
Zabbix
The following is an excerpt from an XML configuration for notification with passive checks for the Zabbix® Monitor using CommandFragment.
Zabbix Example
... <!-- zabbix_sender Zabbix sender utility installed on the JS7 JOC Cockpit host localhost Hostname of the Zabbix server zabbix_server Hostname of the JS7 Agent that is registered with Zabbix ${MON_OS_JOB_NAME} Job name for Item key in Zabbix, see Monitor Variables ${MON_OS_ERROR_TEXT} Error message, see Monitor Variables --> <Message name="notify_on_error"><![CDATA[${MON_OS_ERROR_TEXT}]]></Message> ... <CommandFragment name="zabbix_example"> <MessageRef ref="notify_on_error"/> <Command><![CDATA[zabbix_sender -z localhost -s zabbix_server -k ${MON_OS_JOB_NAME} -o ${MESSAGE}]]></Command> </CommandFragment> ...
Overview
Content Tools