From f13e7b5fa0418ee0fcfa1ac0d83639bde0ac8c39 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 4 Apr 2014 21:46:49 +0200 Subject: [PATCH] Update documentation for custom attribute runtime macros. Refs #5855 --- components/perfdata/perfdatawriter.ti | 26 ++++++++++---------- doc/3.02-commands.md | 4 +-- doc/3.11-performance-data.md | 4 +-- doc/4.3-object-types.md | 5 ++-- doc/8-differences-between-icinga-1x-and-2.md | 4 +-- itl/command-common.conf | 24 +++++++++--------- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/components/perfdata/perfdatawriter.ti b/components/perfdata/perfdatawriter.ti index 5f577aa98..dca86e492 100644 --- a/components/perfdata/perfdatawriter.ti +++ b/components/perfdata/perfdatawriter.ti @@ -22,25 +22,25 @@ class PerfdataWriter : DynamicObject default {{{ return "DATATYPE::HOSTPERFDATA\t" "TIMET::$icinga.timet$\t" - "HOSTNAME::$HOSTNAME$\t" - "HOSTPERFDATA::$HOSTPERFDATA$\t" - "HOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\t" - "HOSTSTATE::$HOSTSTATE$\t" - "HOSTSTATETYPE::$HOSTSTATETYPE$"; + "HOSTNAME::$host.name$\t" + "HOSTPERFDATA::$host.perfdata$\t" + "HOSTCHECKCOMMAND::$host.checkcommand$\t" + "HOSTSTATE::$host.state$\t" + "HOSTSTATETYPE::$host.statetype$"; }}} }; [config] String service_format_template { default {{{ return "DATATYPE::SERVICEPERFDATA\t" "TIMET::$icinga.timet$\t" - "HOSTNAME::$HOSTNAME$\t" - "SERVICEDESC::$SERVICEDESC$\t" - "SERVICEPERFDATA::$SERVICEPERFDATA$\t" - "SERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\t" - "HOSTSTATE::$HOSTSTATE$\t" - "HOSTSTATETYPE::$HOSTSTATETYPE$\t" - "SERVICESTATE::$SERVICESTATE$\t" - "SERVICESTATETYPE::$SERVICESTATETYPE$"; + "HOSTNAME::$host.name$\t" + "SERVICEDESC::$service.description$\t" + "SERVICEPERFDATA::$service.perfdata$\t" + "SERVICECHECKCOMMAND::$service.checkcommand$\t" + "HOSTSTATE::$host.state$\t" + "HOSTSTATETYPE::$host.statetype$\t" + "SERVICESTATE::$service.state$\t" + "SERVICESTATETYPE::$service.statetype$"; }}} }; diff --git a/doc/3.02-commands.md b/doc/3.02-commands.md index ed76d3c6d..3868eab6c 100644 --- a/doc/3.02-commands.md +++ b/doc/3.02-commands.md @@ -182,8 +182,8 @@ information in the check output (`-o`). command = [ PluginDir + "/process_check_result", - "-H", "$HOSTNAME$", - "-S", "$SERVICEDESC$", + "-H", "$host.name$", + "-S", "$service.description$", "-c", "/var/run/icinga2/cmd/icinga2.cmd", "-r", "0", "-o", "Event Handler triggered in state '$SERVICESTATE$' with output '$SERVICEOUTPUT$'." diff --git a/doc/3.11-performance-data.md b/doc/3.11-performance-data.md index cf8253e24..df9498219 100644 --- a/doc/3.11-performance-data.md +++ b/doc/3.11-performance-data.md @@ -25,8 +25,8 @@ Therefore the Icinga 2 `PerfdataWriter` object allows you to define the output template format for host and services backed with Icinga 2 runtime vars. - host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$" - service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$" + host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$" + service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.description$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.statetype$" The default templates are already provided with the Icinga 2 feature configuration which can be enabled using diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index 8056a5c7c..1d178754b 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -520,9 +520,8 @@ Example: service_perfdata_path = "/var/spool/icinga2/perfdata/service-perfdata" - host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$" - - service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$" + host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$" + service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.description$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.statetype$" rotation_interval = 15s } diff --git a/doc/8-differences-between-icinga-1x-and-2.md b/doc/8-differences-between-icinga-1x-and-2.md index 30a65a2fd..846d02a0a 100644 --- a/doc/8-differences-between-icinga-1x-and-2.md +++ b/doc/8-differences-between-icinga-1x-and-2.md @@ -256,7 +256,7 @@ are separated from the command name using an exclamation mark (`!`). define command { command_name ping4 - command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 + command_line $USER1$/check_ping -H $address$ -w $ARG1$ -c $ARG2$ -p 5 } define service { @@ -269,7 +269,7 @@ are separated from the command name using an exclamation mark (`!`). With the freely definable custom attributes in Icinga 2 it looks like this: object CheckCommand "ping4" { - command = PluginDir + "/check_ping -H $HOSTADDRESS$ -w $wrta$,$wpl%$ -c $crta$,$cpl%$" + command = PluginDir + "/check_ping -H $address$ -w $wrta$,$wpl%$ -c $crta$,$cpl%$" } object Service "PING" { diff --git a/itl/command-common.conf b/itl/command-common.conf index 510664a01..0d2db93ea 100644 --- a/itl/command-common.conf +++ b/itl/command-common.conf @@ -23,7 +23,7 @@ object CheckCommand "ping4" { command = [ PluginDir + "/check_ping", "-4", - "-H", "$HOSTADDRESS$", + "-H", "$address$", "-w", "$wrta$,$wpl$%", "-c", "$crta$,$cpl$%", "-p", "$packets$", @@ -44,7 +44,7 @@ object CheckCommand "ping6" { command = [ PluginDir + "/check_ping", "-6", - "-H", "$HOSTADDRESS6$", + "-H", "$address6$", "-w", "$wrta$,$wpl$%", "-c", "$crta$,$cpl$%", "-p", "$packets$", @@ -96,7 +96,7 @@ object CheckCommand "tcp" { command = [ PluginDir + "/check_tcp", - "-H", "$HOSTADDRESS$", + "-H", "$address$", "-p", "$port$" ] } @@ -106,7 +106,7 @@ object CheckCommand "udp" { command = [ PluginDir + "/check_udp", - "-H", "$HOSTADDRESS$", + "-H", "$address$", "-p", "$port$" ] } @@ -125,7 +125,7 @@ object CheckCommand "http_ip" { command = [ PluginDir + "/check_http", - "-H", "$HOSTADDRESS$" + "-H", "$address$" ] } @@ -143,7 +143,7 @@ object CheckCommand "https_ip" { command = [ PluginDir + "/check_http", - "-I", "$HOSTADDRESS$", "-S" + "-I", "$address$", "-S" ] } @@ -152,7 +152,7 @@ object CheckCommand "smtp" { command = [ PluginDir + "/check_smtp", - "-H", "$HOSTADDRESS$" + "-H", "$address$" ] } @@ -161,7 +161,7 @@ object CheckCommand "ssmtp" { command = [ PluginDir + "/check_ssmtp", - "-H", "$HOSTADDRESS$", + "-H", "$address$", "-p", "$port$" ], @@ -173,7 +173,7 @@ object CheckCommand "ntp_time" { command = [ PluginDir + "/check_ntp_time", - "-H", "$HOSTADDRESS$" + "-H", "$address$" ] } @@ -182,7 +182,7 @@ object CheckCommand "ssh" { command = [ PluginDir + "/check_ssh", - "$HOSTADDRESS$" + "$address$" ] } @@ -248,7 +248,7 @@ object CheckCommand "snmp"{ command = [ PluginDir + "/check_snmp", - "-H", "$HOSTADDRESS$", + "-H", "$address$", "-o", "$oid$", "-C", "$community$" ], @@ -277,7 +277,7 @@ object CheckCommand "snmp-extend"{ command = [ IcingaSysconfDir + "/icinga2/scripts/snmp-extend.sh", - "$HOSTADDRESS$", + "$address$", "$community$", "$plugin$" ],