OID REGEX

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

Moderators: Moderators, Developers

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

#16 Post by raX » Tue Apr 26, 2005 5:58 pm

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

#17 Post by ajeskey » Tue Apr 26, 2005 6:37 pm

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: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#18 Post by TheWitness » Tue Apr 26, 2005 6:40 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#19 Post by ajeskey » Tue Apr 26, 2005 6:42 pm

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: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#20 Post by TheWitness » Tue Apr 26, 2005 7:10 pm

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 236 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#21 Post by ajeskey » Tue Apr 26, 2005 7:16 pm

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: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#22 Post by TheWitness » Tue Apr 26, 2005 7:19 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#23 Post by ajeskey » Tue Apr 26, 2005 7:23 pm

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

#24 Post by ajeskey » Tue Apr 26, 2005 7:27 pm

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: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#25 Post by TheWitness » Tue Apr 26, 2005 7:45 pm

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 MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
TheWitness
Developer
Posts: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#26 Post by TheWitness » Tue Apr 26, 2005 7:47 pm

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

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#27 Post by ajeskey » Tue Apr 26, 2005 7:52 pm

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

#28 Post by ajeskey » Tue Apr 26, 2005 8:06 pm

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: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#29 Post by TheWitness » Tue Apr 26, 2005 8:09 pm

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 333 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

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

#30 Post by ajeskey » Tue Apr 26, 2005 8:16 pm

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