[HOWTO] From snmptable to Graphs (Data Query walkthrough)

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

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

Post by gandalf »

For the image "graph_image.php.png"
Please click on it and select one of the wrenches to see the full "rrdtool graph" statement and post this.
For the Data Template issues: Please remember, that NONE of the changes of a Data Template will have effect for already created rrds. And the DEBUG shows only the create statements, cacti will use when generating a new rrd. If you want to know how the ACTUAL rrd is defined, you will have to use "rrdtool info" instead.
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

something's not right about this

Post by paulbeard206 »

These numbers are way wrong:

Code: Select all

CACTID: Host[1] DS[178] SNMP: v2: red.paulbeard.org, dsname: Load_15min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.1, value: 3811363840
CACTID: Host[1] DS[178] SNMP: v2: red.paulbeard.org, dsname: Load_5min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.1, value: 3811363840
CACTID: Host[1] DS[178] SNMP: v2: red.paulbeard.org, dsname: Load_1min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.1, value: 3811363840
CACTID: Host[1] DS[179] SNMP: v2: red.paulbeard.org, dsname: Load_1min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.2, value: 2506841088
CACTID: Host[1] DS[179] SNMP: v2: red.paulbeard.org, dsname: Load_5min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.2, value: 2506841088
CACTID: Host[1] DS[179] SNMP: v2: red.paulbeard.org, dsname: Load_15min, oid: .1.3.6.1.4.1.2021.13.15.1.1.3.2, value: 2506841088
CACTID: Host[1] DS[175] SNMP: v2: red.paulbeard.org, dsname: diskIOReads, oid: .1.3.6.1.4.1.2021.13.15.1.1.5.1, value: 12798961
CACTID: Host[1] DS[180] SNMP: v2: red.paulbeard.org, dsname: diskIOReads, oid: .1.3.6.1.4.1.2021.13.15.1.1.5.2, value: 11097029
CACTID: Host[1] DS[175] SNMP: v2: red.paulbeard.org, dsname: diskIOWrites, oid: .1.3.6.1.4.1.2021.13.15.1.1.6.1, value: 10243703
CACTID: Host[1] DS[180] SNMP: v2: red.paulbeard.org, dsname: diskIOWrites, oid: .1.3.6.1.4.1.2021.13.15.1.1.6.2, value: 19375562
First of the OIDs are wrong. As you can see, they don't change even though the data source changes. No sure what's up with that.

The OID for Load_15min is .1.3.6.1.4.1.2021.13.15.1.1.11.x where x is the index value of the spindle. And that's what the xml file has, as well.

Code: Select all

        <diskIOLA1>
            <name>Load Average (1 min)</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.9</oid>
        </diskIOLA1>
        <diskIOLA5>
            <name>Load Average (5 min)</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.10</oid>
        </diskIOLA5>
        <diskIOLA15>
            <name>Load Average (15 min)</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.11</oid>
        </diskIOLA15>
I suppose I can re-import the xml file. is there something else I should be looking into?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please remember to reload the poller cache (there's a nice script out there) or use Clear Poller Cache which in fact reloads the poller cache. You may have a look at the cache to verify, that current XML OIDs are used
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

Success!

Post by paulbeard206 »

Finally, I got this to work. alas, some of the data isn't useful (the reads/writes are evidently since boot time, so it's just a slope: I was hoping for transactions per second or something).

But load average per spindle is working.

http://www.paulbeard.org/cacti/graph_160.html
http://www.paulbeard.org/cacti/graph_161.html

Now to see if I can export these and use them somewhere else. Sadly, I think my options are limited: last I looked Linux didn't support these values.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Success!

Post by gandalf »

paulbeard206 wrote:Finally, I got this to work. alas, some of the data isn't useful (the reads/writes are evidently since boot time, so it's just a slope: I was hoping for transactions per second or something).

But load average per spindle is working.

http://www.paulbeard.org/cacti/graph_160.html
http://www.paulbeard.org/cacti/graph_161.html

Now to see if I can export these and use them somewhere else. Sadly, I think my options are limited: last I looked Linux didn't support these values.
Fine, but what solved the issue?
For the slope: simply change ds-type from GAUGE to COUNTER and you should be done. You need to change this for the Data Template. All existing rrds would need some rrdtool tune --data-source-type <ds-name>:<ds-type> to reflect this
Reinhard
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Post by JJX »

When i try to load the xml of the example ("Chapter I: Building raw XML file") i get these errors:
Notice: Undefined index: arg_index in /var/www/cacti/lib/data_query.php on line 98

Notice: Undefined index: script_path in /var/www/cacti/lib/data_query.php on line 98

Notice: Undefined index: arg_query in /var/www/cacti/lib/data_query.php on line 109

Notice: Undefined index: query_name in /var/www/cacti/lib/data_query.php on line 109

Notice: Undefined index: script_path in /var/www/cacti/lib/data_query.php on line 109

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cacti/lib/data_query.php:98) in /var/www/cacti/host.php on line 129

any idea?
cacti rulez!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

And your interface XML template are fine?
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

related question?

Post by paulbeard206 »

I whacked some rrd files w/o thinking of the consequences and can't recreate the data sources. How can I clear that up so I can redo those graphs for disk reads/writes?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: related question?

Post by gandalf »

paulbeard206 wrote:I whacked some rrd files w/o thinking of the consequences and can't recreate the data sources. How can I clear that up so I can redo those graphs for disk reads/writes?
Perhaps lack of my understanding of english language, but what exactly is broken? The rrd files or the Data Template? What is left? Any backups in place?
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

not sure how good my english is

Post by paulbeard206 »

Heh. What I meant to say was I removed the RRD files and now I can't re-create the graphs: the data sources are shown as already in use. How can I clean that up?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

As all data is gone, please remove the according Graphs from Graph Management and recreate from the Devices by Create Graphs for this Host
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

can't do that

Post by paulbeard206 »

lvm wrote:As all data is gone, please remove the according Graphs from Graph Management and recreate from the Devices by Create Graphs for this Host
Reinhard
The data items I want to graphs are greyed out, as though they are already being graphed.
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Re: can't do that

Post by nahun »

paulbeard206 wrote:
lvm wrote:As all data is gone, please remove the according Graphs from Graph Management and recreate from the Devices by Create Graphs for this Host
Reinhard
The data items I want to graphs are greyed out, as though they are already being graphed.
I think you need to delete the data sources then try to create the graphs again.
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

been there, done that

Post by paulbeard206 »

<strike>I have done that. It appears I'll have to do something in the database: I just don't know what.</strike>

Looks like this is OK now. I just recreated the graphs after find thme *not* greyed out.
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

still finding some mismatched data

Post by paulbeard206 »

These OIDs should be .1.3.6.1.4.1.2021.13.15.1.1.5.x and .1.3.6.1.4.1.2021.13.15.1.1.6.x.
Data Source: Reads/Writes for ad1
RRD: /usr/local/share/cacti/rra/red_diskiowrites_188.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.13.15.1.1.3.2 (Host: red.paulbeard.org, Community: paulbeard.org)
Data Source: Reads/Writes for ad1
RRD: /usr/local/share/cacti/rra/red_diskiowrites_188.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.13.15.1.1.3.2 (Host: red.paulbeard.org, Community: paulbeard.org)
Data Source: Reads/Writes for ad0
RRD: /usr/local/share/cacti/rra/red_diskiowrites_187.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.13.15.1.1.3.1 (Host: red.paulbeard.org, Community: paulbeard.org)
Data Source: Reads/Writes for ad0
RRD: /usr/local/share/cacti/rra/red_diskiowrites_187.rrd
Action: 0, OID: .1.3.6.1.4.1.2021.13.15.1.1.3.1 (Host: red.paulbeard.org, Community: paulbeard.org)

Code: Select all

        <diskIONRead>
            <name>Read (Bytes)</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.3</oid>
        </diskIONRead>
        <diskIONWritten>
            <name>Written (Bytes)</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.4</oid>
        </diskIONWritten>
        <diskIOReads>
            <name>Reads</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.5</oid>
        </diskIOReads>
        <diskIOWrites>
            <name>Writes</name>
            <method>walk</method>
            <source>value</source>
            <direction>output</direction>
            <oid>.1.3.6.1.4.1.2021.13.15.1.1.6</oid>
        </diskIOWrites>
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests