[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

finn
Posts: 13
Joined: Thu Dec 06, 2007 7:58 pm

Post by finn »

Actually, looks like others have done this with script queries. So I guess it doesn't really matter now. :)

I was hoping I could've done it this way but no matter, it's the end result that counts!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Be prepared to find a decrease of performance of a magnitude between scripts and pure snmp. May be more or even less. I would bet on "more"
Reinhard
vortico
Posts: 4
Joined: Thu Jun 12, 2008 10:34 am

Post by vortico »

Hello all, having issues getting this to work in my particular case. I am trying to get a table of information from a load balancer and graph the active connections and transfer rate information in cacti. I tried following the how to the best I could, the images are mostly gone and its possible I missed a setting somewhere in there if it was checked in the image but no mention of it was made in the text.

Anyway the other issue that exists is there is no nice and easy index like in the example. None of the table entries specify a real index number. I'll post the table/walk and my xml below and what I have done to try to get it to work.

Code: Select all

snmptable -v2c 10.7.2.190 -m ALL .1.3.6.1.4.1.12196.12.2
SNMP table: IPVS-MIB::ipvsRSTable

rSVSidx                 rSDesc rSConns rSInPkts rSOutPkts  rSInBytes  rSOutBytes rSActiveConns rSInactiveConns rSWeight
       0      "10.7.3.24:80  0"   42891  4789869   6043401  884800570  7069382255            65              32     1000
       0      "10.7.3.25:80  0"   51042  7284484   9007608 1634443622 10354617790             0               0     1000
       0      "10.7.3.26:80  0"   10731   609168    663503  150607886   694458104             2               2     1000
       0      "10.7.3.27:80  0"    8438   437582    466524   89117188   496339071             5               1     1000
       0      "10.7.3.28:80  0"   14802  1548995   2305933  641205864  2721785469             6               0     1000
       0      "10.7.3.29:80  0"    8884   439525    470757   99461755   514629001             9              11     1000
       0      "10.7.3.30:80  0"    4677   280089    326477   48829737   365153253             0               0     1000
       1      "10.7.3.24:80  0"      33     1655      2256     223604     2755637             0               0     1000
       1      "10.7.3.25:80  0"     171     6773      9710    1257452    11818896             0               0     1000
       2 "10.7.3.14:443 Masq 0"     516  5541178   7354382  266144096  2349993137            16               0     1000
       2 "10.7.3.15:443 Masq 0"     455  4947440   6467919  236864381  1920543903            17               0     1000
       2 "10.7.3.16:443 Masq 0"     511  5253701   7548277  244424731  2433626351            16               0     1000
       3      "10.7.3.31:80  0"      21     1610      1941     421697     1865476             0               0     1000
       4 "10.7.3.17:443 Masq 0"       3       77        90       4802       17251             0               0     1000
       ?                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
       0                      ?       ?        ?         ?          ?           ?             ?               ?        ?
snmpwalk -v2c -On 10.7.2.189 -m All .1.3.6.1.4.1.12196.12.2

Code: Select all

.1.3.6.1.4.1.12196.12.2.1.1.1 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.2 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.3 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.4 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.5 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.6 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.7 = INTEGER: 0
.1.3.6.1.4.1.12196.12.2.1.1.8 = INTEGER: 1
.1.3.6.1.4.1.12196.12.2.1.1.9 = INTEGER: 1
.1.3.6.1.4.1.12196.12.2.1.1.10 = INTEGER: 2
.1.3.6.1.4.1.12196.12.2.1.1.11 = INTEGER: 2
.1.3.6.1.4.1.12196.12.2.1.1.12 = INTEGER: 2
.1.3.6.1.4.1.12196.12.2.1.1.13 = INTEGER: 3
.1.3.6.1.4.1.12196.12.2.1.1.14 = INTEGER: 4
.1.3.6.1.4.1.12196.12.2.1.11.1 = STRING: "10.7.3.24:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.2 = STRING: "10.7.3.25:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.3 = STRING: "10.7.3.26:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.4 = STRING: "10.7.3.27:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.5 = STRING: "10.7.3.28:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.6 = STRING: "10.7.3.29:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.7 = STRING: "10.7.3.30:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.8 = STRING: "10.7.3.24:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.9 = STRING: "10.7.3.25:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.10 = STRING: "10.7.3.14:443 Masq 0"
.1.3.6.1.4.1.12196.12.2.1.11.11 = STRING: "10.7.3.15:443 Masq 0"
.1.3.6.1.4.1.12196.12.2.1.11.12 = STRING: "10.7.3.16:443 Masq 0"
.1.3.6.1.4.1.12196.12.2.1.11.13 = STRING: "10.7.3.31:80  0"
.1.3.6.1.4.1.12196.12.2.1.11.14 = STRING: "10.7.3.17:443 Masq 0"
.1.3.6.1.4.1.12196.12.2.1.12.1 = Counter32: 43229
.1.3.6.1.4.1.12196.12.2.1.12.2 = Counter32: 51042
.1.3.6.1.4.1.12196.12.2.1.12.3 = Counter32: 10757
.1.3.6.1.4.1.12196.12.2.1.12.4 = Counter32: 8451
.1.3.6.1.4.1.12196.12.2.1.12.5 = Counter32: 14831
.1.3.6.1.4.1.12196.12.2.1.12.6 = Counter32: 8939
.1.3.6.1.4.1.12196.12.2.1.12.7 = Counter32: 4689
.1.3.6.1.4.1.12196.12.2.1.12.8 = Counter32: 33
.1.3.6.1.4.1.12196.12.2.1.12.9 = Counter32: 171
.1.3.6.1.4.1.12196.12.2.1.12.10 = Counter32: 517
.1.3.6.1.4.1.12196.12.2.1.12.11 = Counter32: 456
.1.3.6.1.4.1.12196.12.2.1.12.12 = Counter32: 512
.1.3.6.1.4.1.12196.12.2.1.12.13 = Counter32: 21
.1.3.6.1.4.1.12196.12.2.1.12.14 = Counter32: 3
.1.3.6.1.4.1.12196.12.2.1.13.1 = Counter32: 4866536
.1.3.6.1.4.1.12196.12.2.1.13.2 = Counter32: 7284484
.1.3.6.1.4.1.12196.12.2.1.13.3 = Counter32: 610483
.1.3.6.1.4.1.12196.12.2.1.13.4 = Counter32: 443944
.1.3.6.1.4.1.12196.12.2.1.13.5 = Counter32: 1552134
.1.3.6.1.4.1.12196.12.2.1.13.6 = Counter32: 443650
.1.3.6.1.4.1.12196.12.2.1.13.7 = Counter32: 280229
.1.3.6.1.4.1.12196.12.2.1.13.8 = Counter32: 1655
.1.3.6.1.4.1.12196.12.2.1.13.9 = Counter32: 6773
.1.3.6.1.4.1.12196.12.2.1.13.10 = Counter32: 5592156
.1.3.6.1.4.1.12196.12.2.1.13.11 = Counter32: 4997948
.1.3.6.1.4.1.12196.12.2.1.13.12 = Counter32: 5307843
.1.3.6.1.4.1.12196.12.2.1.13.13 = Counter32: 1610
.1.3.6.1.4.1.12196.12.2.1.13.14 = Counter32: 77
.1.3.6.1.4.1.12196.12.2.1.14.1 = Counter32: 6131167
.1.3.6.1.4.1.12196.12.2.1.14.2 = Counter32: 9007608
.1.3.6.1.4.1.12196.12.2.1.14.3 = Counter32: 664915
.1.3.6.1.4.1.12196.12.2.1.14.4 = Counter32: 473271
.1.3.6.1.4.1.12196.12.2.1.14.5 = Counter32: 2309328
.1.3.6.1.4.1.12196.12.2.1.14.6 = Counter32: 477211
.1.3.6.1.4.1.12196.12.2.1.14.7 = Counter32: 326587
.1.3.6.1.4.1.12196.12.2.1.14.8 = Counter32: 2256
.1.3.6.1.4.1.12196.12.2.1.14.9 = Counter32: 9710
.1.3.6.1.4.1.12196.12.2.1.14.10 = Counter32: 7422175
.1.3.6.1.4.1.12196.12.2.1.14.11 = Counter32: 6533056
.1.3.6.1.4.1.12196.12.2.1.14.12 = Counter32: 7624796
.1.3.6.1.4.1.12196.12.2.1.14.13 = Counter32: 1941
.1.3.6.1.4.1.12196.12.2.1.14.14 = Counter32: 90
.1.3.6.1.4.1.12196.12.2.1.15.1 = Counter64: 902093888
.1.3.6.1.4.1.12196.12.2.1.15.2 = Counter64: 1634443622
.1.3.6.1.4.1.12196.12.2.1.15.3 = Counter64: 150808778
.1.3.6.1.4.1.12196.12.2.1.15.4 = Counter64: 90494292
.1.3.6.1.4.1.12196.12.2.1.15.5 = Counter64: 641881532
.1.3.6.1.4.1.12196.12.2.1.15.6 = Counter64: 100015998
.1.3.6.1.4.1.12196.12.2.1.15.7 = Counter64: 48838776
.1.3.6.1.4.1.12196.12.2.1.15.8 = Counter64: 223604
.1.3.6.1.4.1.12196.12.2.1.15.9 = Counter64: 1257452
.1.3.6.1.4.1.12196.12.2.1.15.10 = Counter64: 268592355
.1.3.6.1.4.1.12196.12.2.1.15.11 = Counter64: 239307577
.1.3.6.1.4.1.12196.12.2.1.15.12 = Counter64: 246906059
.1.3.6.1.4.1.12196.12.2.1.15.13 = Counter64: 421697
.1.3.6.1.4.1.12196.12.2.1.15.14 = Counter64: 4802
.1.3.6.1.4.1.12196.12.2.1.16.1 = Counter64: 7165521933
.1.3.6.1.4.1.12196.12.2.1.16.2 = Counter64: 10354617790
.1.3.6.1.4.1.12196.12.2.1.16.3 = Counter64: 696001485
.1.3.6.1.4.1.12196.12.2.1.16.4 = Counter64: 503305947
.1.3.6.1.4.1.12196.12.2.1.16.5 = Counter64: 2725439457
.1.3.6.1.4.1.12196.12.2.1.16.6 = Counter64: 522587738
.1.3.6.1.4.1.12196.12.2.1.16.7 = Counter64: 365249512
.1.3.6.1.4.1.12196.12.2.1.16.8 = Counter64: 2755637
.1.3.6.1.4.1.12196.12.2.1.16.9 = Counter64: 11818896
.1.3.6.1.4.1.12196.12.2.1.16.10 = Counter64: 2370962364
.1.3.6.1.4.1.12196.12.2.1.16.11 = Counter64: 1939430160
.1.3.6.1.4.1.12196.12.2.1.16.12 = Counter64: 2457667713
.1.3.6.1.4.1.12196.12.2.1.16.13 = Counter64: 1865476
.1.3.6.1.4.1.12196.12.2.1.16.14 = Counter64: 17251
.1.3.6.1.4.1.12196.12.2.1.17.1 = Counter32: 71
.1.3.6.1.4.1.12196.12.2.1.17.2 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.17.3 = Counter32: 2
.1.3.6.1.4.1.12196.12.2.1.17.4 = Counter32: 5
.1.3.6.1.4.1.12196.12.2.1.17.5 = Counter32: 5
.1.3.6.1.4.1.12196.12.2.1.17.6 = Counter32: 7
.1.3.6.1.4.1.12196.12.2.1.17.7 = Counter32: 1
.1.3.6.1.4.1.12196.12.2.1.17.8 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.17.9 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.17.10 = Counter32: 16
.1.3.6.1.4.1.12196.12.2.1.17.11 = Counter32: 16
.1.3.6.1.4.1.12196.12.2.1.17.12 = Counter32: 15
.1.3.6.1.4.1.12196.12.2.1.17.13 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.17.14 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.1 = Counter32: 35
.1.3.6.1.4.1.12196.12.2.1.18.2 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.3 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.4 = Counter32: 1
.1.3.6.1.4.1.12196.12.2.1.18.5 = Counter32: 1
.1.3.6.1.4.1.12196.12.2.1.18.6 = Counter32: 1
.1.3.6.1.4.1.12196.12.2.1.18.7 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.8 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.9 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.10 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.11 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.12 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.13 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.18.14 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.19.1 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.2 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.3 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.4 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.5 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.6 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.7 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.8 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.9 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.10 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.11 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.12 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.13 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.19.14 = Counter32: 1000
.1.3.6.1.4.1.12196.12.2.1.20.1 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.2 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.3 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.4 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.5 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.6 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.7 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.8 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.9 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.10 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.11 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.12 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.13 = Counter32: 0
.1.3.6.1.4.1.12196.12.2.1.20.14 = Counter32: 0
I started creating the following xml file:

Code: Select all

<interface>
        <name>Get ipvsRSTableh Information</name>
        <description>Get SNMP based Real Server infomration from a Kemp Load Balancer</description>
        <index_order_type>numeric</index_order_type>
        <oid_index>.1.3.6.1.4.1.12196.12.2</oid_index>
        <fields>
                <rSDesc>
                        <name>Description</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.12196.12.2.1.11</oid>
                </rSDesc>
                <rSVSidx>
                        <name>Virtual Server Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.12196.12.2.1.1</oid>
                </rSVSidx>
                <rSConns>
                        <name>RS Total Connections</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.12196.12.2.1.12</oid>
                </rSConns>
        </fields>
</interface>
I created a data query in Cacti then, and it successfully loaded the XML. Added the query to my device, ran the verbose query and got the following:

Code: Select all

+ Running data query [13].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/resource/snmp_queries/ipvsRSTable.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.12196.12.2'
+ Located input field 'rSDesc' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12196.12.2.1.11'
+ Found item [rSDesc='10.7.3.24:80 0'] index: 1 [from value]
+ Found item [rSDesc='10.7.3.25:80 0'] index: 2 [from value]
+ Found item [rSDesc='10.7.3.26:80 0'] index: 3 [from value]
+ Found item [rSDesc='10.7.3.27:80 0'] index: 4 [from value]
+ Found item [rSDesc='10.7.3.28:80 0'] index: 5 [from value]
+ Found item [rSDesc='10.7.3.29:80 0'] index: 6 [from value]
+ Found item [rSDesc='10.7.3.30:80 0'] index: 7 [from value]
+ Found item [rSDesc='10.7.3.24:80 0'] index: 8 [from value]
+ Found item [rSDesc='10.7.3.25:80 0'] index: 9 [from value]
+ Found item [rSDesc='10.7.3.14:443 Masq 0'] index: 10 [from value]
+ Found item [rSDesc='10.7.3.15:443 Masq 0'] index: 11 [from value]
+ Found item [rSDesc='10.7.3.16:443 Masq 0'] index: 12 [from value]
+ Found item [rSDesc='10.7.3.31:80 0'] index: 13 [from value]
+ Found item [rSDesc='10.7.3.17:443 Masq 0'] index: 14 [from value]
+ Located input field 'rSVSidx' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12196.12.2.1.1'
+ Found item [rSVSidx='0'] index: 1 [from value]
+ Found item [rSVSidx='0'] index: 2 [from value]
+ Found item [rSVSidx='0'] index: 3 [from value]
+ Found item [rSVSidx='0'] index: 4 [from value]
+ Found item [rSVSidx='0'] index: 5 [from value]
+ Found item [rSVSidx='0'] index: 6 [from value]
+ Found item [rSVSidx='0'] index: 7 [from value]
+ Found item [rSVSidx='1'] index: 8 [from value]
+ Found item [rSVSidx='1'] index: 9 [from value]
+ Found item [rSVSidx='2'] index: 10 [from value]
+ Found item [rSVSidx='2'] index: 11 [from value]
+ Found item [rSVSidx='2'] index: 12 [from value]
+ Found item [rSVSidx='3'] index: 13 [from value]
+ Found item [rSVSidx='4'] index: 14 [from value]
+ Found data query XML file at '/var/www/html/resource/snmp_queries/ipvsRSTable.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/ipvsRSTable.xml'
+ Found data query XML file at '/var/www/html/resource/snmp_queries/ipvsRSTable.xml'
I then created a data template with the following configuration options:

Data Template - Name: kemp - rsConns
Data Source - Name: (checked) kemp_rsConns
Data Input Method - Get SNMP Data (Indexed)
Associated RRA's - (All Selected)
Step - 300
Data Source Active - (Checked)

Data Source Item - Internal Data Source Name - rsConns
Minimum Value/Maximum Value - 0
Data Source Type - Counter
Heartbeat - 600

Custom Data - Index Type (checked)
Custom Data - Index Value (checked)
Custom Data - Output Type ID (checked)

I then made a simple graph, called it kemp - rsConns and added a line1 graph type, average consolidation function and linked it to the data source rsConns I defined above.

I proceded to add the graph template to the data query. I did not however put anything in suggested values.

And now I am at a point where I create the graph, but nothing is ever put into a RRD file. If I go to Data Sources and turn on debug mode I get the following:

Code: Select all

/usr/bin/rrdtool create \
/var/www/html/rra/kemp_lb1_rsconns_546.rrd \
--step 300  \
DS:rsConns:COUNTER:600:0:U \
RRA:AVERAGE:0.5:1:10080 \
RRA:AVERAGE:0.5:1:25920 \
RRA:AVERAGE:0.5:6:9000 \
RRA:AVERAGE:0.5:24:2250 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:10080 \
RRA:MIN:0.5:1:25920 \
RRA:MIN:0.5:6:9000 \
RRA:MIN:0.5:24:2250 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:10080 \
RRA:MAX:0.5:1:25920 \
RRA:MAX:0.5:6:9000 \
RRA:MAX:0.5:24:2250 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:10080 \
RRA:LAST:0.5:1:25920 \
RRA:LAST:0.5:6:9000 \
RRA:LAST:0.5:24:2250 \
RRA:LAST:0.5:288:797 \
Any ideas what could be causing the problem? If I set the value in the XML to input it does get picked up by Cacti (granted you can't graph it but I knew that would happen). Any help would be appreciated.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please try using .1.3.6.1.4.1.12196.12.2.1.1 as an <oid_index>. It will span from 1 to 14.
This howto is now abandoned and continued at http://docs.cacti.net. But you may open a new thread at any time to ask your questions
Reinhard
ak
Posts: 8
Joined: Sat Jun 04, 2005 2:18 pm
Location: Latvia,Riga
Contact:

Post by ak »

How do I filter certain values in snmp walk using snmp query? I have following output:

Code: Select all

IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.5 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.6 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.7 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.8 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.9 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.10 = INTEGER: atm(37)
IF-MIB::ifType.11 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.12 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.13 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.14 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.15 = INTEGER: ethernetCsmacd(6)
If I need only atm(37) interfaces what that filter could be applied in snmp query?[/code]
in2deep
Posts: 22
Joined: Thu Jan 13, 2011 9:39 pm

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by in2deep »

Thanks for the excellent walkthrough. I got the Diskio graph to work, but the problem is I have no idea what i'm graphing. The device name do not make any sense to me. I have a bunch of ram0-10+, sda1+, etc.... device names to graph but I have no clue what they are associated with e.g /x/home (a nsf mount point). Is there a command to find out the device names = some path names? Really appreciate if you can answer my question. Thanks in advance.

Tho
Operating System:Linux version 2.6.18-164.el5
Webserver: Apache/2.2.17
Cacti:8.7g
Spine:rpm 8.7g
MySQL:Server version: 5.5.8
PHP: 5.3.5
RRDTool (Cygwin or Win32 version): 1.4.4
Net-SNMP: 5.3
Plugin Architecture: 2.8
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by gandalf »

The command "mount" should help
R.
in2deep
Posts: 22
Joined: Thu Jan 13, 2011 9:39 pm

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by in2deep »

Thanks for the reply. I tried but none of the output strings match the snmp device names output. Other suggestions are welcome.

Tho
Operating System:Linux version 2.6.18-164.el5
Webserver: Apache/2.2.17
Cacti:8.7g
Spine:rpm 8.7g
MySQL:Server version: 5.5.8
PHP: 5.3.5
RRDTool (Cygwin or Win32 version): 1.4.4
Net-SNMP: 5.3
Plugin Architecture: 2.8
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by noname »

in2deep wrote:I have a bunch of ram0-10+, sda1+, etc.... device names to graph but I have no clue what they are associated with e.g /x/home (a nsf mount point).
Is there a command to find out the device names = some path names?
Try iostat, then mount.

Example on Solaris:

Code: Select all

% iostat -x
                  extended device statistics
device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b
dad1         0.7    1.4    6.6    8.2  0.0  0.0    6.2   0   0
fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
sd1          0.0    0.0    0.0    0.0  0.0  0.0    1.4   0   0
nfs1         0.0    0.0    0.0    0.0  0.0  0.0    6.1   0   0

% iostat -xn
                    extended device statistics
    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
    0.7    1.4    6.6    8.2  0.0  0.0    3.1    3.1   0   0 c0t0d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 fd0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    1.4   0   0 c0t1d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    6.1   0   0 myserver:vold(pid473)
For more detail about partitions, add -p option:

Code: Select all

% iostat -xp
                  extended device statistics
device       r/s    w/s   kr/s   kw/s wait actv  svc_t  %w  %b
dad1         0.7    1.4    6.6    8.2  0.0  0.0    6.2   0   0
dad1,a       0.1    0.1    1.0    0.1  0.0  0.0    4.4   0   0
dad1,b       0.2    0.0    1.2    1.6  0.0  0.0   24.9   0   0
dad1,c       0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
dad1,d       0.3    0.3    2.8    0.5  0.0  0.0    7.4   0   0
dad1,e       0.0    0.2    0.1    0.6  0.0  0.0    1.3   0   0
dad1,f       0.0    0.0    0.0    0.0  0.0  0.0   10.5   0   0
dad1,h       0.1    0.7    1.5    5.5  0.0  0.0    3.5   0   0
fd0          0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
sd1          0.0    0.0    0.0    0.0  0.0  0.0    1.4   0   0
nfs1         0.0    0.0    0.0    0.0  0.0  0.0    6.1   0   0

% iostat -xnp
                    extended device statistics
    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
    0.7    1.4    6.6    8.2  0.0  0.0    3.1    3.1   0   0 c0t0d0
    0.1    0.1    1.0    0.1  0.0  0.0    1.7    2.8   0   0 c0t0d0s0
    0.2    0.0    1.2    1.6  0.0  0.0   16.5    8.3   0   0 c0t0d0s1
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c0t0d0s2
    0.3    0.3    2.8    0.5  0.0  0.0    2.8    4.6   0   0 c0t0d0s3
    0.0    0.2    0.1    0.6  0.0  0.0    0.8    0.5   0   0 c0t0d0s4
    0.0    0.0    0.0    0.0  0.0  0.0    7.4    3.1   0   0 c0t0d0s5
    0.1    0.7    1.5    5.5  0.0  0.0    1.7    1.9   0   0 c0t0d0s7
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 fd0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    1.4   0   0 c0t1d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    6.1   0   0 myserver:vold(pid473)
in2deep
Posts: 22
Joined: Thu Jan 13, 2011 9:39 pm

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by in2deep »

Noname, THANKS!!! :D
Operating System:Linux version 2.6.18-164.el5
Webserver: Apache/2.2.17
Cacti:8.7g
Spine:rpm 8.7g
MySQL:Server version: 5.5.8
PHP: 5.3.5
RRDTool (Cygwin or Win32 version): 1.4.4
Net-SNMP: 5.3
Plugin Architecture: 2.8
zztop2006
Posts: 21
Joined: Thu Dec 31, 2015 2:55 am

Re: [HOWTO] From snmptable to Graphs (Data Query walkthrough

Post by zztop2006 »

hi
I used from this XML:

Code: Select all

<interface>
        <name>Get SNMP Interfaces1</name>
        <description>Queries a host for a list of monitorable interfaces1</description>
        <oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>
        <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
        <index_order>ifIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>

	<fields>
		<ifIndex>
			<name>Index</name>
			<method>walk</method>
			<source>value</source>
			<direction>input</direction>
			<oid>.1.3.6.1.2.1.2.2.1.1</oid>
		</ifIndex>
		<ifOperStatus>
			<name>Status</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.8</oid>
		</ifOperStatus>
		<ifDescr>
			<name>Description</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.2</oid>
		</ifDescr>
		<ifName>
			<name>Name (IF-MIB)</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.31.1.1.1.1</oid>
		</ifName>
		<ifAlias>
			<name>Alias (IF-MIB)</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.31.1.1.1.18</oid>
		</ifAlias>
		<ifType>
			<name>Type</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.3</oid>
		</ifType>
		<ifSpeed>
			<name>Speed</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.5</oid>
		</ifSpeed>
		<ifHighSpeed>
			<name>High Speed</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.31.1.1.1.15</oid>
		</ifHighSpeed>
		<ifHwAddr>
			<name>Hardware Address</name>
			<method>walk</method>
			<source>value</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.2.2.1.6</oid>
		</ifHwAddr>
		<ifIP>
			<name>IP Address</name>
			<method>walk</method>
			<source>OID/REGEXP:.*\.([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$</source>
			<direction>output</direction>
			<oid>.1.3.6.1.2.1.4.20.1.2</oid>
		</ifIP>
	</fields>
</interface>
i define proper data queri and data template and Graph Template for all output Objects.
then create Graph for High Speed and status without any problem and work fin but i donn't know how can i display MAC Address at bottom a graph like this:
ss.png
ss.png (22.65 KiB) Viewed 9923 times
any idea?
closen
Posts: 7
Joined: Tue Jun 21, 2022 5:22 am

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

Post by closen »

Hello,
Thank you very much for this guide. The problem is that I'm sutck in the 1st step. Indeed I'm not used to use snmp ...
So my cacti server is on centos 7. I just install it and right now I'm trying to connect to a device (VSAT) that is on iDirect. I hope I'm following the good guide for that.
So my problem is that when I'm trying to run : snmptable -c <community> -v 1 <host> HOST-RESOURCES-MIB::hrStorageTable.
When I use the Ip of the server I've this result :
End of MIB
HOST-RESOURCES-MIB::hrStorageTable: No entries
When I use the Ip of the VSAT I've this result :
Timeout: No Response from xxx.xx.x.x.
Honnestly it's been 2 days I'm looking to find solutions and nothing is working.
(snmp is enable and is running, I don't have the right to connect to the VSAT so I can't check anything on it.)
I hope someone will be able to help me.

By the way I'm an intern at the moment so I'm doing my best to learn.
Best regards,
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests