HWG STE2 Temperature Monitoring - no discovery of services

Hello community,

i have a HWG STE2 temperature monitoring box. I´ve noticed that there is a check-plugin integrated in check_mk for this device. Unfortunately after creating the host in WATO and click on “save and go to services” there is no service discovered. I have double checked SNMP settings. If i click on “save and test” only the following output is displayed in SNMPv1 and SNMPv2c (without bulkwalk):

sysDescr: STE2
sysContact: the configured snmp contact
sysName: the configured hostname
sysLocation: the configured snmp location

If i do a snmpwalk from the console and enter the direct OID from e.g. the temperature sensor i got the right value.

I´m using Check_MK 1.6.0p6 Enterprise

But check_mk discovers nothing. Thanks anyone for help.

Christian

@chr_systems,

The hwg_temp check scans for “hwg” string in .1.3.6.1.2.1.1.1.0 OID, after that (and only if it matches), scans for all of these OID list :

.1.3.6.1.4.1.21796.4.1.3.1.1 (Index)
.1.3.6.1.4.1.21796.4.1.3.1.2 (sensName)
.1.3.6.1.4.1.21796.4.1.3.1.3 (sensState)
.1.3.6.1.4.1.21796.4.1.3.1.4 (sensString)
.1.3.6.1.4.1.21796.4.1.3.1.7 (sensUnit)

It gathers all the values from these OID’s and processes them into a parse function and only after that parsing goes into inventory function.

The parsed data will have 5 items ( description, dev_unit, temperature, dev_status_name and dev_status.
The inventory function will get (parsed) and will apply this logic :

if attrs[“dev_status_name”] not in [“invalid”, “”]
and attrs[“dev_unit”] in [“c”, “f”, “k”]:
yield index, {}

This means that it will only inventory items that “dev_status_name” are not “invalid” and “dev_units” are one of the “c”, “f” or “k”.

Perhaps you have an old or even recent version of HWG device that needs an update on the check.

Get a look into the code and check the logic and run some snmpwalks for the OID’s in the check.

Cheers,

1 Like

at some devices i had a simalar problem.

I fixed it with a direct check at the console:

as site user
cmk -Iv --checks=check_as_you_want_to_test hostname

cmk -Iv --checks=cisco_mem sw-de-munich-01

the name of the checks you can see at WATO

image

if the check matches the Service will be active after a

cmk -Ov

Greets Bernd

by the way often not all services will be discovered … but after a manual check yes

1 Like

@BH2005 @ricardoftribeiro,

thank´s for your support. You point me in the right direction.

  1. My device is a HW Group STE2. In the OID .1.3.6.1.2.1.1.1.0 it states not “hwg” rather “STE2” so i have to adjust the check plugin hwg_temp for this
    — Line 115: “snmp_scan_function”: lambda oid: “STE2” in oid(".1.3.6.1.2.1.1.1.0", “”).lower(),

  2. The HWG STE2 uses different OIDs for the sensors.
    — Line 107 has to be changed to: “.1.3.6.1.4.1.21796.4.9.3”,

  3. The HWG STE2 doesn´t support the GetBulk SNMP function. So i create a SNMP Legacy rule in Check_MK for this device. Then everything works - the service is discovered and the values are correct.

Unfortunately I am not a good programmer, otherwise I would write a new check right away. Hope the post helps others who have the same device.

Kind regards

perhaps another solution is put the nagios check from here:

https://exchange.icinga.com/netways/check_hwgroup

in the local check folder and try again or compare the code

You have already noticed the changes to make. Copy the check to your ~/local/share/check_mk/checks and give it a shot!
I believe you won’t get any worst!

Cheers,

@chr_systems

This solution looks so logical and so good, but when I tried it it didn’t work.

I made the two changes in the plugin file. Now I’m able to contact the STE2 device, but the service is not discovered. That would seem to mean that the GetBulk call is not working?

I’ve set host properties to SNMP v1 and added a rule to have the host use Legacy SNMP devices using SNMP v2c.

Any suggestions as to what I’m still missing? Or what I can do to test what’s going wrong?

Hello,

i remember this issue. Finally i had to discover the service via console. In the web gui it doesn´t work.
Try the following command: cmk -Iv --checks=hwg_temp HOSTNAME

(or replace “–checks=hwg_temp” with your own check filename if you have create one)

Important: Restart the core after you modify the hwg_temp check! Otherwise your changes are not effective!

as I said :wink:

try it via console first

OK, thanks @chr_systems and @BH2005! I got it working.

Some comments for people who read this in the future:

  • I made a copy of the original file share/check_mk/checks/hwg_temp in local/share/check_mk/checks/hwg2_temp
  • Then I changed the check name in hwg2_tmp with the following line:
    sed -i -e "s/hwg_temp/hwg2_temp/g" hwg2_temp
  • Perform direct check:
    cmk -Iv --checks=hwg2_temp hostname
  • Restart the core:
    cmk -R
  • When the core restarts, the function name in the file needs to correspond to the file name. I originally had them different and got an error message.