Mittels sog.: "Custom Object Variables" kann man in nagios eigene Variablen erzeugen in der Form:
define host{
host_name linuxserver
<b>_mac_address 00:06:5B:A6:AD:AA</b> ; <-- Custom MAC_ADDRESS variable
<b>_rack_number R32</b> ; <-- Custom RACK_NUMBER variable
...
} |
define host{
host_name linuxserver
<b>_mac_address 00:06:5B:A6:AD:AA</b> ; <-- Custom MAC_ADDRESS variable
<b>_rack_number R32</b> ; <-- Custom RACK_NUMBER variable
...
}
Aber wie zeigt man diese dann auch im Web-Interface an?
Dies geht ganz einfach, indem man sie der notes-Option weiter gibt, z.B.:
define host {
host_name web01
display_name web01
address 8.8.4.4
_mac_address 00:21:9B:00:21:9B
_sw_port_1 sw01_g3
<b>notes $_HOSTMAC_ADDRESS$ $_HOSTSW_PORT_1$</b>
hostgroups +webservers
use web_servers
} |
define host {
host_name web01
display_name web01
address 8.8.4.4
_mac_address 00:21:9B:00:21:9B
_sw_port_1 sw01_g3
<b>notes $_HOSTMAC_ADDRESS$ $_HOSTSW_PORT_1$</b>
hostgroups +webservers
use web_servers
}
Quelle: serverfault: [http://serverfault.com/questions/233022/how-do-i-display-nagios-host-custom-variables-or-macros-in-the-web-interface|How do I Display Nagios Host Custom Variables or Macros in the Web Interface?]