OID REGEX

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

Moderators: Developers, Moderators

raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Since a few of you asked above, the two regular expression match functions only work with POSIX regular expressions, not Perl-based ones. If you look in the code, the exact function that is used to match the string is ereg_replace().

I wish I would have realized this before, but all of the options for the "source" item in the XML file only apply to input fields. That is, Cacti uses this information when running the data query, which subsequently affects the data that ends up in the data query cache. What you are left with is a single SNMP OID for each item that is passed directly onto the poller. All the poller sees is the OID at this point, so it only returns the literal value and moves on.

With that in mind, being able to parse output in the poller would be a great feature. As is the case here, it would mainly be useful when dealing with brain dead SNMP implementations since there is little that you can do to affect their output. Feel free to add a bug to bugs.cacti.net if you would like to see this added at some point.

As for now, your best bet is to create a script query which handles all of the parsing for you. It might be a bit more work than an SNMP query, but it would definitely return the results that you are looking for.

-Ian
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

WAHOO! Not crazy!

I will bite the bullet for now. But I will put it in as a bug report.

Thanks everyone for the help.
- Aaron Jeskey
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

As long as you are running cmd.php, I will provide a fix, but only after we release 0.8.6d. I need some quality time with Cactid. So it will take longer.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

i am still using cmd.php.

I was actualy just debating trying it on my own... I'll see what I can do to night, and submit it tomrrow if I am just not getting it.
- Aaron Jeskey
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please try this lib\functions.php with your build and see if it makes the problem go away.

TheWitness
Attachments
functions.zip
(14.26 KiB) Downloaded 276 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

almost... still returned a "partial"

04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 875
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1365
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 1: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 2: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 2240
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1365
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 3: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 4: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 840
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 2240

obviously i need to work on my regex for some of them
- Aaron Jeskey
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please post a debug of the same information and then I am concerned about the following:
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 1: 1400
04/26/2005 08:12:33 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 2: 1400
Please explain the "Bay x:"

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

For a blade center, you have power domains, a power domain is made up of (curently) 2 power supplies. So the "bay" is the "slot/bay" the power supply is in.


That would be a nice to have, sonce the "bay" can have different sized PSUs installed. Currently I have 1400 Watt PSUs. It would be nice to have to base the graph scall off of. Inother words I dont NEED it but. it would be nice. Obviosuly I am more concerned with the usage. I am turning on a hight debug, will post it in a min

The following is the regex that I use for power domain 1. It does worl via the input method.


<bcblademmINdomain1max>
<name>Power Domain 1 Unit Max Watts</name>
<method>walk</method>
<source>VALUE/REGEXP:Bay [0-9]: ([0-9]{1,4})W$</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4</oid>
</bcblademmINdomain1max>
- Aaron Jeskey
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: Host responded to SNMP
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] RECACHE: Processing 1 items in the auto reindex cache for 'XXX.XXX.XXXX.XXX'.
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 840
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRRemain, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.9.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRReserve, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.8.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 2240
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRBudget, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 3: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmDomain1Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 4: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmDomain2Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRInUse, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.2, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1365
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRInUse, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.1, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 875
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRRemain, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.9.1, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 1365
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRReserve, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.8.1, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: 2240
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmPWRBudget, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7.1, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 1: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmDomain1Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4.1, output: U
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 2: 1400
04/26/2005 08:23:47 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXXX.XXX, dsname: bcblademmDomain2Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5.1, output: U
- Aaron Jeskey
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Ok,

I am currently only trimming the trailing non-numeric data. Not data at the front of the string. Therefore, can you make the output not contain the prefix information? I will have another version quite soon.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Here's another lib\functions.php to test. Please post DEBUG again.

TheWitness
Attachments
functions.zip
(14.26 KiB) Downloaded 222 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

wahoo

04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: Host responded to SNMP
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] RECACHE: Processing 1 items in the auto reindex cache for 'XXX.XXX.XXX.XXX'.
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 1: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmDomain1Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4.1, output: U
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 2: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmDomain2Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5.1, output: U
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRBudget, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7.1, output: 224
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRReserve, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.8.1, output: 136
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRRemain, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.9.1, output: 87
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRInUse, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.1, output: 136
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRInUse, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.10.2, output: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRRemain, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.9.2, output: 84
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRReserve, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.8.2, output: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmPWRBudget, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.7.2, output: 224
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 3: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmDomain1Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.4.2, output: U
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] WARNING: Result from SNMP not valid. Partial Result: Bay 4: 140
04/26/2005 08:48:35 PM - CMDPHP: Poller[0] Host[53] SNMP: v1: XXX.XXX.XXX.XXX, dsname: bcblademmDomain2Max, oid: .1.3.6.1.4.1.2.3.51.2.2.10.1.1.1.5.2, output: U
- Aaron Jeskey
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

Still getting a "nan" and no graphs... debug isnt reporting anything out of the ordinary...

I wonder if it would be better to take the ereg_replace code from data_query.php and put that in to the cmd.php

I did remove the domain max queries from the data source, so that shouldn't interfear
- Aaron Jeskey
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I'm carving off 1 too many characters. I have another to give. Please try this one. Sorry for the repetition on this.

TheWitness
Attachments
functions.zip
(14.28 KiB) Downloaded 355 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
ajeskey
Cacti User
Posts: 93
Joined: Mon Mar 28, 2005 4:31 pm
Location: Boston, MA

Post by ajeskey »

Trying it now.

Belive me I am not irked at all! I am just glad to have it as close as it is now.

Wi'lll update you in a few min.
- Aaron Jeskey
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests