[HOWTO] Add new MIB Variables to Cacti

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

tafirol
Posts: 15
Joined: Sun May 22, 2005 9:43 am

Post by tafirol »

I will try to clarify what I´m looking for ; )
the thing is that I have an script running and I can use only one index by script, no problem there. But, now I have get information from 2 indexes, and I have no idea of what I have to write into the script. I hope that you understand my point.

thanks in advance,

Tafi ROL
tafirol
Posts: 15
Joined: Sun May 22, 2005 9:43 am

Post by tafirol »

Well I read the documentation and but the aid of others posts I could obtain it.

thanks... :)
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

please post your discovery here, so that the next person to have the question knows where to look. nothing is more frustrating than having a question, finding someone else who had the question, and then finding a post that says, "i figured it out," without any further information.

tx.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
tafirol
Posts: 15
Joined: Sun May 22, 2005 9:43 am

Post by tafirol »

Is true ....
Here is my script, I hope that it helps you.

releated posts
http://forums.cacti.net/viewtopic.php?t=7710

Greetings

:D
Attachments
gx_perf_path_fe.xml
(1.74 KiB) Downloaded 797 times
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

I am having trouble getting this to work. I have followed the document very closely and even retried creating everything about 3 times. I am still getting the following error when i try to add the Data Query to the Device under the device configuration area. Any ideas?

Code: Select all

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

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

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

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

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

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

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

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

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

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

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

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/cacti/lib/data_query.php:98) in /var/www/html/cacti/host.php on line 110
I tried snmpwalk and got good responses for these OIDs...

Code: Select all

[cacti@hector cacti]$ snmpwalk -c <community> 10.10.10.20 .1.3.6.1.4.1.1872.2.1.5.2.1.1
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.1.3 = INTEGER: 3
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.1.4 = INTEGER: 4
[cacti@hector cacti]$ snmpwalk -c <community> 10.10.10.20 .1.3.6.1.4.1.1872.2.1.5.2.1.2
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.2.1 = IpAddress: 10.10.10.31
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.2.2 = IpAddress: 10.10.10.26
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.2.3 = IpAddress: 10.10.10.27
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.2.4 = IpAddress: 10.10.10.32
[cacti@hector cacti]$ snmpwalk -c <community> 10.10.10.20 .1.3.6.1.4.1.1872.2.1.5.2.1.12
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.12.1 = ""
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.12.2 = ""
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.12.3 = ""
SNMPv2-SMI::enterprises.1872.2.1.5.2.1.12.4 = ""
[cacti@hector cacti]$ snmpwalk -c <community> 10.10.10.20 .1.3.6.1.4.1.1872.2.1.8.2.5.1.2
SNMPv2-SMI::enterprises.1872.2.1.8.2.5.1.2.1 = Gauge32: 0
SNMPv2-SMI::enterprises.1872.2.1.8.2.5.1.2.2 = Gauge32: 130
SNMPv2-SMI::enterprises.1872.2.1.8.2.5.1.2.3 = Gauge32: 134
SNMPv2-SMI::enterprises.1872.2.1.8.2.5.1.2.4 = Gauge32: 0
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

walking the OIDs has nothing to do with the errors you're posting. i believe that those errors mean that your data query is broken. if you go to the data query, you should see the line "Successfully located XML file" in green under the query information. It's as though the data query that you're adding doesn't have any information in it, which is what's creating those errors.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

I think my Data Query is ok... as well as the data source. Can you see any problems in it? I also pasted my xml file. I am new to cacti but i think i have gotten the hang of it... this xml snmp query stuff is confusing me though. I have successfully gotten it to work using perl scripts to check nsclient on windows hosts.

Code: Select all

[cacti@hector cacti]$ cat /var/www/html/cacti/resource/snmp_queries/alteon_real_servers.xml
<query>
  <name>Get Alteon Real Server Information</name>
  <index_order_type>numeric</index_order_type>
  <oid_index>.1.3.6.1.4.1.1872.2.1.5.2.1.1</oid_index>

  <fields>
    <slbCurCfgRealServerIndex>
      <name>Number</name>
      <method>walk</method>
      <source>value</source>
      <direction>input</direction>
      <oid>.1.3.6.1.4.1.1872.2.1.5.2.1.1</oid>
    </slbCurCfgRealServerIndex>
    <slbCurCfgRealServerIpAddr>
          <name>IP Address</name>
          <method>walk</method>
          <source>value</source>
          <direction>input</direction>
          <oid>.1.3.6.1.4.1.1872.2.1.5.2.1.2</oid>
        </slbCurCfgRealServerIpAddr>

        <slbCurCfgRealServerName>
          <name>Name</name>
          <method>walk</method>
          <source>value</source>
          <direction>input</direction>
          <oid>.1.3.6.1.4.1.1872.2.1.5.2.1.12</oid>
        </slbCurCfgRealServerName>

        <slbStatRServerCurrSessions>
          <name>Current Sessions</name>
          <method>walk</method>
          <source>value</source>
          <direction>output</direction>
          <oid>.1.3.6.1.4.1.1872.2.1.8.2.5.1.2</oid>
        </slbStatRServerCurrSessions>
  </fields>
</query>
Attachments
Data Template
Data Template
3.PNG (54.19 KiB) Viewed 21058 times
Associated Graph Template (under Data Query)
Associated Graph Template (under Data Query)
2.PNG (20.7 KiB) Viewed 21058 times
Data Query
Data Query
1.PNG (17.06 KiB) Viewed 21058 times
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

Change your Data Query to "Get SNMP Data (Indexed)" instead of Script data.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

so sorry about that :oops:
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

Does it work now?
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
Alives
Cacti User
Posts: 103
Joined: Mon Jul 11, 2005 11:39 am

Post by Alives »

yes that was it... naturally i feel stupid for overlooking such a vital selection...
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

pish posh. a second set of eyes is always a good thing. you'd been staring at it for hours, so something like that is easy to overlook. good job on including the screenshots - it made it possible for me to help.

i'm glad it worked!
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
User avatar
moe_szyslak
Posts: 47
Joined: Thu Jul 21, 2005 1:19 pm
Location: Germany

Post by moe_szyslak »

Hello to all,

I tried the steps for making a SNMP query for cacti, but I made somewhere a mistake. the result is, thar no rra files are created and there is no image at the graph management.

I think the data query and the xml are correct, because I can see the information at device->associated data queries->verbose query.

About the combination about the Templates I am not sure.

Does anyone has an idea?


Thx
Moe
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

the steps in the how-to are complete. if you made a mistake and missed something, your best bet is to start over and go through it with greater care.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
User avatar
moe_szyslak
Posts: 47
Joined: Thu Jul 21, 2005 1:19 pm
Location: Germany

Post by moe_szyslak »

I have done evrything from the howto. I differed at No. 6, there ich made a graph to an existing host. Everything runs well at 'verbose query' - 'create graph for this host' etc.

But when I look at Graph Management I got the message 'open ...79.rrd - No such file or directory' and the RRA file is not in the directory.

A question about the field Data Query: Must there any entries at 'Associated Graph Templates' - 'Suggested Values' ?


Moe
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests