[solved] Filter in data query

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

Moderators: Developers, Moderators

Post Reply
skycode
Posts: 7
Joined: Tue Sep 08, 2009 10:15 am

[solved] Filter in data query

Post by skycode »

Hi,

I'm trying to graph the value reported in a sensor table in snmp, that table contains information about temperature and fan rotation all mixed up. There is a column named type that says if the line actually contains a value related to a fan or to the local temperature. Can I use VALUE/REGEXP in the data query XML file to filter the line that I want ... If yes how can I do that ? Is there any better way ?

Thanks in advance

Cheers
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Have you read through http://docs.cacti.net/ yet?
skycode
Posts: 7
Joined: Tue Sep 08, 2009 10:15 am

Post by skycode »

Yes, and I understand how to use VALUE/REGEXP to extract part of the value but I don't understand how to use it to completly ignore a line of the table ....

Will it ignore the line if it doesn't match at all ?

Thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post an example of the output in question
Reinhard
skycode
Posts: 7
Joined: Tue Sep 08, 2009 10:15 am

Post by skycode »

Hi,

here is the Table :

Code: Select all

 swSensorIndex swSensorType swSensorStatus swSensorValue     swSensorInfo
             1  temperature        nominal            28 SLOT #0: TEMP #1
             2  temperature        nominal            29 SLOT #0: TEMP #2
             3          fan        nominal          4129           FAN #1
             4          fan        nominal          4129           FAN #2
             5          fan        nominal          4129           FAN #3
             6 power-supply        nominal             1  Power Supply #1
and here is the xml I currently use :

Code: Select all

<sensors>
        <name>StorageWorks switch Sensors</name>
        <description>Queries HP StorageWorks Sensor Table</description>
        <oid_index>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.1</oid_index>
        <index_order_type>numeric</index_order_type>

        <fields>
                <swSensorIndex>
                        <name>Sensor Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.1</oid>
                </swSensorIndex>
                <swSensorType>
                        <name>Sensor Type</name>
                        <method>walk</method>
                        <source>VALUE/REGEXP:BYTES</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2</oid>
                </swSensorType>
                <swSensorInfo>
                        <name>Sensor Info</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5</oid>
                </swSensorInfo>
                <swSensorStatus>
                        <name>Sensor Status</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3</oid>
                </swSensorStatus>
                <swSensorValue>
                        <name>Sensor Value</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4</oid>
                </swSensorValue>
        </fields>
</sensors>
What I would like to do is to have the entries pertaning to the temperature sensor in a differrent data query than the ones related to fan speed.

Thanks in advance for your help !
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Hmm wonder if it's possible to limit the output based on the swSensorType type...

Personally, I'd just have 3 associated graph templates (and their required data templates) for your main HP StorageWorks Sensor Data Query. One for temp, fans, power. Then from the drop down box for the data query, you'd just select the correct graph type for the swSensorType. simplifies the whole segregation issue since the data is already all there.
skycode
Posts: 7
Joined: Tue Sep 08, 2009 10:15 am

Post by skycode »

Hi, thanks for your answer,

That's actually what I did (two graph templates, one for fans, one for temperature) I was just wondering if I can prevent from having the temperature sensor showing up when I'm creating a graph for fan on a device (all sensors appear in the list) ...

But anyway that's a very minor drawback.

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests