What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Problem with a Synology UPS OID

Votes:

0

Hello Folks,

I have a mystery here.

I try to monitor a Synology NAS DS413 which works mostly perfect.

To the NAS a APC Back-UPS is attached. In the MIB files from Synology there's a value for the battery charge shown in percent.

If I try to retrieve value with the iReasoning MIB Browser I get this:Name/OID: .1.3.6.1.4.1.6574.4.3.1.1.0; Value (Opaque): 100.0

If I try the same with the Paessler SNMP Tester 5.1.3 I get this:

24.05.2015 19:28:40 (13 ms) : Device: 192.168.181.101
24.05.2015 19:28:40 (23 ms) : SNMP V3
24.05.2015 19:28:40 (31 ms) : Custom OID 1.3.6.1.4.1.6574.4.3.1.1.0
24.05.2015 19:28:40 (196 ms) : -------
24.05.2015 19:28:40 (207 ms) : Value: NAN (Unknown data type (= 120-1001) (SNMP error # -1001))
24.05.2015 19:28:40 (213 ms) : Done

This is the same error I get in PRTG when I set up a SNMP sensor.

What is here the matter, why didn't it work?

Kind reagrds Adama

exexml prtg snmp synology ups usv

Created on May 24, 2015 5:40:50 PM

Last change on Jun 9, 2015 5:25:40 AM by  Luciano Lingnau [Paessler]



Best Answer

Accepted Answer

Votes:

6

Ah, I see...

I have extended the script a little bit with channels for status, UPS load, estimated battery runtime and battery voltage (like to share it):


Param(
  [string]$hostname,
  [string]$community
  )

#Get UPS status
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.2.1.0
$status = $var.replace(" ","")
$upsstatus = switch -regex ($status)
	{
		"OBDISCHRG" {"3"; break}
		"OLCHRG" {"2"; break}
		"OL" {"1"}
	}

#Get Battery Charge
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.1.1.0
$pos = $var.IndexOf(".")
$leftPart = $var.Substring(0, $pos)

#Get battery runtime
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.6.1.0
$time = $var/3600

#Get current load
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.2.12.1.0
$pos = $var.IndexOf(".")
$load = $var.Substring(0, $pos)

#Get battery voltage
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.2.1.0
$voltage = $var

#Create Sensor
 Write-Host "<prtg>"
 Write-Host "<result>"
 Write-Host "<channel>UPS Status</channel>"
 Write-Host "<value>$upsstatus</value>"
 Write-Host "<valuelookup>prtg.standardlookups.Synology.UPSstatus</valuelookup>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Charge Level</channel>"
 Write-Host "<value>$leftPart</value>"
 Write-Host "<unit>Percent</unit>"
 Write-Host "<LimitMinError>30</LimitMinError>"
 Write-Host "<LimitMinWarning>40</LimitMinWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>UPS load</channel>"
 Write-Host "<value>$load</value>"
 Write-Host "<unit>Percent</unit>"
 Write-Host "<LimitMaxError>95</LimitMaxError>"
 Write-Host "<LimitMaxWarning>90</LimitMaxWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Est. Runtime</channel>"
 Write-Host "<value>$time</value>"
 Write-Host "<unit>s</unit>"
 Write-Host "<float>1</float>"
 Write-Host "<LimitMinError>0.1</LimitMinError>"
 Write-Host "<LimitMinWarning>0.2</LimitMinWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Voltage</channel>"
 Write-Host "<value>$voltage</value>"
 Write-Host "<unit>V</unit>"
 Write-Host "<float>1</float>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "</prtg>"


You need this lookup to show the status circle:

<?xml version="1.0" encoding="UTF-8"?>
<ValueLookup id="prtg.standardlookups.Synology.UPSstatus" desiredValue="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd">
	<Lookups>
		<SingleInt state="Ok" value="1">AC Power</SingleInt>
		<SingleInt state="Warning" value="2">AC Power / Battery charging</SingleInt>
		<SingleInt state="Error" value="3">Battery Power</SingleInt>
	</Lookups>
</ValueLookup>

Kind regards
Ingo

Edit: Added <valuelookup>prtg.standardlookups.Synology.UPSstatus</valuelookup> to the output of the first channel "UPS Status".

NEW:: As of 05/08/2015 PRTG is able to natively recognize this datatype. More info below

Created on Jun 8, 2015 5:10:24 PM

Last change on Feb 1, 2018 12:12:21 PM by  Luciano Lingnau [Paessler]



11 Replies

Votes:

0

Hi,
could you try setting up a SNMP Custom String Sensor? This one would interpret the returned value as string. Afterwards the numerical value could be extracted in the sensor.
Best regards

Created on May 26, 2015 8:18:11 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hi,

done this just now.

In this case I get "Unknown data type (= 120-1001) (SNMP-Fehler # -1001)" from the sensor back

Best regards Ingo

Created on May 26, 2015 5:37:38 PM



Votes:

0

Hello
I've checked the MIB from Synology and it looks fine(That OID returns a Gauge data type). What version of DSM are you running on the NAS?

Previously did you try to use the SNMP Custom Sensor ?

Could you please perform "WALK" using our SNMP tester, please use the appropriate community and the v2c version of SNMP. Please perform the walk on the following OID:

1.3.6.1.4.1.6574

Save the result to a log file and send it to [email protected] and add (PA561128) to the email's tittle. With the walk and the mib-file we'll be able to try to reproduce this.

Best regards,

Created on May 28, 2015 11:43:00 AM by  Luciano Lingnau [Paessler]



Votes:

0

Hi,

sorry, forgot to mention it, I tried the SNMP Custom Sensor for this...

Version of DSM on my DS413 is DSM 5.2-5565 Update 1.

The Log file is underway...

Best regards Ingo

Created on May 28, 2015 6:27:53 PM



Votes:

0

The 1.3.6.1.4.1.6574.4.3.1.1.0 OID is of the Opaque (Float) data type which is currently not supported by PRTG, we are currently working on making PRTG compatible with it.

Created on Jun 3, 2015 12:52:12 PM by  Luciano Lingnau [Paessler]



Votes:

0

Thanks for your effort.

I'm looking forward to it...

Best regards Ingo

Created on Jun 3, 2015 4:29:34 PM



Votes:

0

In the meantime, if you have NET-SNMP installed on the probe, you can add a custom exe/xml script to get that value into PRTG, the %host and %snmpcommunity parameter has to be provided when creating the EXE/Script Advanced Sensor.

Param(
  [string]$hostname,
  [string]$community
  )

$var = snmpget.exe -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.1.1.0
$pos = $var.IndexOf(".")
$leftPart = $var.Substring(0, $pos)

 Write-Host "<prtg>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Charge</channel>"
 Write-Host "<value>$leftPart</value>"
 Write-Host "<Unit>Percent</Unit>"
 Write-Host "<LimitMinError>30</LimitMinError>"
 Write-Host "<LimitMinWarning>40</LimitMinWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "</prtg>"

Created on Jun 5, 2015 8:39:09 AM by  Luciano Lingnau [Paessler]



Votes:

0

You guys are marvelous, works fantastic...

Had to made a little change:

$var = cmd / "path\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.1.1.0

Without it, I got a message that the cmdlet is unrecognized.

And the placeholder %snmpcommunity seems not to be existing.

Created on Jun 5, 2015 6:26:21 PM



Votes:

0

Thank you for your feedback. We're glad it worked out for you.

There can be significant differences in the powershell command depending on Powershell version and OS Version, that could cause the "cmdlet is unrecognized" issue.

About the issue with the %snmpcommunity, The community string is for SNMP v1 or v2 (may be inherited from parent). If you're using V3 that would be the issue.

Created on Jun 8, 2015 8:50:14 AM by  Luciano Lingnau [Paessler]



Accepted Answer

Votes:

6

Ah, I see...

I have extended the script a little bit with channels for status, UPS load, estimated battery runtime and battery voltage (like to share it):


Param(
  [string]$hostname,
  [string]$community
  )

#Get UPS status
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.2.1.0
$status = $var.replace(" ","")
$upsstatus = switch -regex ($status)
	{
		"OBDISCHRG" {"3"; break}
		"OLCHRG" {"2"; break}
		"OL" {"1"}
	}

#Get Battery Charge
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.1.1.0
$pos = $var.IndexOf(".")
$leftPart = $var.Substring(0, $pos)

#Get battery runtime
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.6.1.0
$time = $var/3600

#Get current load
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.2.12.1.0
$pos = $var.IndexOf(".")
$load = $var.Substring(0, $pos)

#Get battery voltage
$var = cmd /c "C:\Program Files\usr\bin\snmpget.exe" -c $community -v 2c -Oqv $hostname .1.3.6.1.4.1.6574.4.3.2.1.0
$voltage = $var

#Create Sensor
 Write-Host "<prtg>"
 Write-Host "<result>"
 Write-Host "<channel>UPS Status</channel>"
 Write-Host "<value>$upsstatus</value>"
 Write-Host "<valuelookup>prtg.standardlookups.Synology.UPSstatus</valuelookup>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Charge Level</channel>"
 Write-Host "<value>$leftPart</value>"
 Write-Host "<unit>Percent</unit>"
 Write-Host "<LimitMinError>30</LimitMinError>"
 Write-Host "<LimitMinWarning>40</LimitMinWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>UPS load</channel>"
 Write-Host "<value>$load</value>"
 Write-Host "<unit>Percent</unit>"
 Write-Host "<LimitMaxError>95</LimitMaxError>"
 Write-Host "<LimitMaxWarning>90</LimitMaxWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Est. Runtime</channel>"
 Write-Host "<value>$time</value>"
 Write-Host "<unit>s</unit>"
 Write-Host "<float>1</float>"
 Write-Host "<LimitMinError>0.1</LimitMinError>"
 Write-Host "<LimitMinWarning>0.2</LimitMinWarning>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "<result>"
 Write-Host "<channel>Battery Voltage</channel>"
 Write-Host "<value>$voltage</value>"
 Write-Host "<unit>V</unit>"
 Write-Host "<float>1</float>"
 Write-Host "<LimitMode>1</LimitMode>"
 Write-Host "</result>"
 Write-Host "</prtg>"


You need this lookup to show the status circle:

<?xml version="1.0" encoding="UTF-8"?>
<ValueLookup id="prtg.standardlookups.Synology.UPSstatus" desiredValue="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd">
	<Lookups>
		<SingleInt state="Ok" value="1">AC Power</SingleInt>
		<SingleInt state="Warning" value="2">AC Power / Battery charging</SingleInt>
		<SingleInt state="Error" value="3">Battery Power</SingleInt>
	</Lookups>
</ValueLookup>

Kind regards
Ingo

Edit: Added <valuelookup>prtg.standardlookups.Synology.UPSstatus</valuelookup> to the output of the first channel "UPS Status".

NEW:: As of 05/08/2015 PRTG is able to natively recognize this datatype. More info below

Created on Jun 8, 2015 5:10:24 PM

Last change on Feb 1, 2018 12:12:21 PM by  Luciano Lingnau [Paessler]



Votes:

0

That's awesome, thanks for sharing!

Update (05.08.2015)

PRTG's version 15.3.18.3378 is able to recognize the Opaque Float format, in that version a SNMP Custom Sensor for the 1.3.6.1.4.1.6574.4.3.1.1.0 OID displays the correct result 100.

Created on Jun 9, 2015 5:26:02 AM by  Luciano Lingnau [Paessler]

Last change on Aug 5, 2015 1:07:28 PM by  Luciano Lingnau [Paessler]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.