How to only fetch the first two numbers ???

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Arrow2005
Cacti User
Posts: 54
Joined: Thu Nov 03, 2005 3:07 pm
Contact:

How to only fetch the first two numbers ???

Post by Arrow2005 »

Im building a graph where the data gets collected using snmp.

All works fine until temperature........... Datatemplate works fine...

when checking the log I get this: WARNING: Result from SNMP not valid. Partial Result: 36 C/96

how do I solve so I only graph the value 36 ??

tryed to find the answer on this by searching the forum but no luck, thankfull for fast answer


"# snmpwalk -v 2c -c private 10.10.10.11:161 .1.3.6.1.4.1.24681.1.2.11.1.3.1
SNMPv2-SMI::enterprises.24681.1.2.11.1.3.1 = STRING: "36 C/96 F""

maybe need to write a xml to make this ??
never done that and didn´t understand how to parse
if you can patch it to day, why dont whait util 2morrow
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: How to only fetch the first two numbers ???

Post by gandalf »

Please use VALUE/REGEXP. see docs at 1st link of my sig
R.
Arrow2005
Cacti User
Posts: 54
Joined: Thu Nov 03, 2005 3:07 pm
Contact:

Re: How to only fetch the first two numbers ???

Post by Arrow2005 »

Seems like Im not getting this to work, was reading about
OID/REGEXP

But I must be tired or slow, have been trying to get something to work
but nothing seems to work. but it´s just to keep trying
I only want the first 2 numbers in the answer, not all of it

What Im trying to fix is to only get the first 2 numbers in the answer:
12/25/2010 10:25:16 PM - CMDPHP: Poller[0] Host[2] DS[19] WARNING: Result from SNMP not valid. Partial Result: 33 C/91

The answer I get it still 33 C/91 and I ony want the 33
if you can patch it to day, why dont whait util 2morrow
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: How to only fetch the first two numbers ???

Post by gandalf »

It's not OID/REGEXP, it's VALUE/REGEXP. Shortly, the allows to apply REGEXP to values
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests