HP Switches autodisovery - hostname from SNMP sysInfo


I have many HP switches which I’m auto-discovering from an IP range in to CheckMK 1.6.0 Raw. This is using SNMPv2 and a specific community string.

The switches are all being discovered and all the interfaces, CPU, fans, memory, uptime are all successfully graphing and logging which is great. (Using hp_procure_sensors etc)

However, I don’t know how to use the hostname specified in the switches in CheckMK instead of just the IP address. It is visible in both snmp_info and mgmt_snmp_info plugins, for example:

ProCurve J9145A 2910al-24G Switch, revision W.14.38, ROM W.14.04 (/sw/code/build/sbm(t4a)), Room C, Room C Switch 1, ITSupport

(Room C is the snmp hostname, Room C Switch 1 is the location and ITSupport is the contact)

But I don’t know how to extract that and create a rule to rename the host in CheckMK automatically.

Please can someone point me in the right direction?

Many thanks :smile:


Use DNS PTR records for that purpose. This makes CheckMK to use the name instead of the IP when using the network scan feature.

Renaming a host after discovering it is quite expensive in CheckMK. The hostname is the unique key for everything regarding the host entry.

Thanks. Good tip.

For future reference, is there a way I can pull the SNMP hostname either during or after auto discovery?

You can use the Multisite API for pulling information out of CheckMK: https://checkmk.com/cms_legacy_multisite_automation.html

Either from the SNMP Info service check or the SNMP system name is also part of the HW/SW inventory data if you configure that additionally: https://checkmk.com/cms_inventory.html

1 Like