SNMP get temperature

Started by NickDoro, March 28, 2018, 04:03:04 PM

Previous topic - Next topic

NickDoro

Hello,

I need some help with netxms bluecoat configuration , so i have 5 different proxys and all of them are on one template , but they are using 2 different versions of bluecoat , so one of them uses this .1.3.6.1.4.1.3417.2.1.1.1.1.1.5.5 oid to monitor CPU temp and others this .1.3.6.1.4.1.3417.2.1.1.1.1.1.5.20 oid to monitor CPU temperature.

I want to add object which determines what proxy it is , and then add oid which one is needed.

Here is what i did:

Created new object that is looking for proxy name (for example: proxy1.dmd.lv, proxy2.dmd.lv and so on).
Then i added few lines in object -> proporties -> transformation

if ($1 == proxy1.dmd.lv)
{
    value = SNMPGetValue(CPU temperature, ".1.3.6.1.4.1.3417.2.1.1.1.1.1.5.5");
    return (value);
}
else
{
    value = SNMPGetValue(CPU temperature, ".1.3.6.1.4.1.3417.2.1.1.1.1.1.5.20");
    return (value);
}

but this script wasnt working for me , so could someone help me fix it?

Tursiops

Hi,

Based on what I can see at http://www.oidview.com/mibs/3417/SENSOR-MIB.html, the value you are trying to poll is part of a table.
That means you should probably create a single template using Instance Discovery using .1.3.6.1.4.1.3417.2.1.1.1.1.1.1 as Base SNMP OID, instead of creating two different templates. You could probably also poll 1.3.6.1.4.1.3417.2.1.1.1.1.1.9 as part of your Instance Discovery script to return the name of the sensor for the DCI.

The filter script would look similar to this:
transport = CreateSNMPTransport($node);
if (transport == null) return null;
sensorName = SNMPGetValue(transport, ".1.3.6.1.4.1.3417.2.1.1.1.1.1.9." . $1);
if (sensorName == null) return false;
return %(true,$1,sensorName);

I have no idea if the sensor name will always exist on this device or not. The code above will not create a DCI if a name does not exist. In fact, it will remove it if it can't find a name.

You can then reference the sensor name in your DCI description as {instance-name} and the instance itself in the DCI parameter as {instance}.
The parameter should therefore look like this:
.1.3.6.1.4.1.3417.2.1.1.1.1.1.5.{instance}
The description could be this:
Bluecoat Temperature Sensor ({instance-name})

Cheers