Hello all!
I am deploying Zabbix in my company, and so far I have found it to be an excellent product. It is also my first foray in setting up a proper Linux-based server here and spreading the word of Free Software.
I have a few snags that have come up while setting it up, and I am struggling to find any information on the documentations or on the forums for these situations.
Is it possible to have per-Host Exceptions in Discovery/Triggers?
We have some hosts where we want to monitor certain attributes about discovered items and trigger when those attributes are beyond certain thresholds. In some other cases, we only want to monitor, but not trigger.
Some examples:
({Template - Duet - Cisco Core Switch:IF-MIB_ifAdminStatus.["{#SNMPINDEX}"].last(0)}<>{Template - Duet - Cisco Core Switch:IF-MIB_ifOperStatus.["{#SNMPINDEX}"].last(0)}) AND {#SNMPVALUE} <> {$HOSTEXCLUDEDINTF}
where $HOSTEXCLUDEDINTF is the host-level macro that contains the excluded interfaces?
What is the most appropriate way of doing the above using Zabbix?
Discovery rules and temperature sensors
I have set up a discovery rule for my HP servers' temperature sensors. I have followed the guide to discover SNMP OIDs and got to the point where I have my data feeding nicely into Zabbix.
Each HP sensor has several OIDs, three of which are of interest to me:
- cpqHeTemperatureLocale, which is an INTEGER that represents the location of the sensor (11 = ambient, 6 = CPU, etc.)
- cpqHeTemperatureCelsius, which is self-descriptive
- cpqHeTemperatureThreshold which indicates the maximum temperature value
Now, in the guide, it says that for the discovery rule itself:
"The OIDs to discover are defined in SNMP OID field in the following format: discovery[{#MACRO1}, oid1, {#MACRO2}, oid2, …,]"
So I thought great, what we can do is that since the cpqHeTemperatureLocale represents the location of the sensor and is an immutable attribute of it, I will set the SNMP OID to
discovery[{#LOCATION},CPQHLTH-MIB::cpqHeTemperatureLocale]
And the name of the items to
Temperature Condition {#SNMPINDEX} - {#LOCATION}
Sadly, because cpqHeTemperatureLocale is an INTEGER value, it will set {#LOCATION} to 11, 6, or whatever value represents the location of the sensor**.
For now, I have created an item prototype. This means that I cannot use the translated sensor location in the sensor name, which makes the "latest data" list VERY long and full of "Temperature Sensor 1" up to "Temperature Sensor 44", and then a "Temperature Location 1" to "Temperature Location 44". It would be much, MUCH more useful if it could say "Temperature Sensor 1 - Ambient Inlet".
Is there any way to have Zabbix set the macro to the translated value?
Thank you all!
-----
* = This relates to a metro Ethernet link which is delivered on two ports, only one of which is active at any given time. When the telco equipment senses that the primary port is down, it brings up the secondary. At A end the telco gives us copper hand-off, at the other it's fibre. The switches at either ends are exactly identical, so it'd be better if I could define per-host exceptions rather than having to create 2 different templates for devices that are exactly the same, and only the "exceptional" ports are meant to remain unmonitored.
** = See this for all possible mappings
I am deploying Zabbix in my company, and so far I have found it to be an excellent product. It is also my first foray in setting up a proper Linux-based server here and spreading the word of Free Software.
I have a few snags that have come up while setting it up, and I am struggling to find any information on the documentations or on the forums for these situations.
Is it possible to have per-Host Exceptions in Discovery/Triggers?
We have some hosts where we want to monitor certain attributes about discovered items and trigger when those attributes are beyond certain thresholds. In some other cases, we only want to monitor, but not trigger.
Some examples:
- A server whose disk drive E: is a swap partition for a database, and said database will always maintain a swap file occupying 90% of the available space. In this case, I would like Zabbix to keep gathering data about this partition, but not trigger.
- A switch where we want to trigger on all ports that are not shutdown, but are disconnected. All ports except for one, which is meant to always be disconnected but not shutdown*.
({Template - Duet - Cisco Core Switch:IF-MIB_ifAdminStatus.["{#SNMPINDEX}"].last(0)}<>{Template - Duet - Cisco Core Switch:IF-MIB_ifOperStatus.["{#SNMPINDEX}"].last(0)}) AND {#SNMPVALUE} <> {$HOSTEXCLUDEDINTF}
where $HOSTEXCLUDEDINTF is the host-level macro that contains the excluded interfaces?
What is the most appropriate way of doing the above using Zabbix?
Discovery rules and temperature sensors
I have set up a discovery rule for my HP servers' temperature sensors. I have followed the guide to discover SNMP OIDs and got to the point where I have my data feeding nicely into Zabbix.
Each HP sensor has several OIDs, three of which are of interest to me:
- cpqHeTemperatureLocale, which is an INTEGER that represents the location of the sensor (11 = ambient, 6 = CPU, etc.)
- cpqHeTemperatureCelsius, which is self-descriptive
- cpqHeTemperatureThreshold which indicates the maximum temperature value
Now, in the guide, it says that for the discovery rule itself:
"The OIDs to discover are defined in SNMP OID field in the following format: discovery[{#MACRO1}, oid1, {#MACRO2}, oid2, …,]"
So I thought great, what we can do is that since the cpqHeTemperatureLocale represents the location of the sensor and is an immutable attribute of it, I will set the SNMP OID to
discovery[{#LOCATION},CPQHLTH-MIB::cpqHeTemperatureLocale]
And the name of the items to
Temperature Condition {#SNMPINDEX} - {#LOCATION}
Sadly, because cpqHeTemperatureLocale is an INTEGER value, it will set {#LOCATION} to 11, 6, or whatever value represents the location of the sensor**.
For now, I have created an item prototype. This means that I cannot use the translated sensor location in the sensor name, which makes the "latest data" list VERY long and full of "Temperature Sensor 1" up to "Temperature Sensor 44", and then a "Temperature Location 1" to "Temperature Location 44". It would be much, MUCH more useful if it could say "Temperature Sensor 1 - Ambient Inlet".
Is there any way to have Zabbix set the macro to the translated value?
Thank you all!
-----
* = This relates to a metro Ethernet link which is delivered on two ports, only one of which is active at any given time. When the telco equipment senses that the primary port is down, it brings up the secondary. At A end the telco gives us copper hand-off, at the other it's fibre. The switches at either ends are exactly identical, so it'd be better if I could define per-host exceptions rather than having to create 2 different templates for devices that are exactly the same, and only the "exceptional" ports are meant to remain unmonitored.
** = See this for all possible mappings