I wanted to graph different aspects of my db server. I made 3 scripts that find values for mysql (Threads Connected, Threads Cached, and Threads Running)
Cacti will find the values based on an snmp query. The problem is that SNMP returns my result as a string.
so i ask:
1. How can i get snmp (or my script that snmp runs) to return the value as an INTEGER?
2. What is the best way to graph this in cacti? I'm trying to just copy the Load Average template, and then just change the data sources that it uses. The graph says "nan", but I believe that is because snmp is returning a STRING value.
Custom SNMP oid
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Custom SNMP oid
You surely found the already existing MySQL Templates?arimus wrote:I wanted to graph different aspects of my db server. I made 3 scripts that find values for mysql (Threads Connected, Threads Cached, and Threads Running)
Cacti accepts numeric "strings"Cacti will find the values based on an snmp query. The problem is that SNMP returns my result as a string.
You may create a copy of the "SNMP - Generic OID" Data Template and fill in your own OID (Recommendation: rename the data source from snmp_oid to sth more descriptive). Apply this procedure to each of your OIDs. Then build a Graph Template referring to those data sources. As a start, refer to the second to last link of my signature2. What is the best way to graph this in cacti? I'm trying to just copy the Load Average template, and then just change the data sources that it uses. The graph says "nan", but I believe that is because snmp is returning a STRING value.
Reinhard
Well, I following the Additional Scripts from cacti's page. I found a few php scripts but, I had already written the same thing in "sh". It's just getting it to work via SNMP that i was having trouble with. And unfortunately I think the answer to that is create custom MIB's for MySQL.You surely found the already existing MySQL Templates?
You don't appear to have a signature at this moment.[/url]refer to the second to last link of my signature
The other thing im not sure of is how to graph the data sources. when to use gprint/gauge/counter ect. I read up on this a few years ago and it got me more confused then I was when i started. I guess i'll have to read up again
... unless of course some one has graph templates for MySQL??
What am i doing wrong then.Cacti accepts numeric "strings"
I created a datatemplete. For data source type i wasn't sure, so i tried counter, and also absolute.
at the bottom, i have my oid .1.3.6.1.4.1.5000.101.101.1
(which remember i pretty much copied all this from the ucd/net load average.
I tried to graph it but on the graph it says "Connected: 0" (which before it said 'nan')
It works in the cmd line (just as a string rather then int)
Code: Select all
# snmpwalk -v1 -c **** 192.168.1.4 .1.3.6.1.4.1.5000.101.101.1
SNMPv2-SMI::enterprises.5000.101.101.1 = STRING: "1"
Am i missing something
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
MySQL Host template: http://forums.cacti.net/viewtopic.php?t=11010
COUNTER may be compared to the mileage of a car (continuously increasing), whereas GAUGE may be compared to the speed (showing the actual data when querying), You may consult http://www.rrdtool.org for more precise description
Reinhard
COUNTER may be compared to the mileage of a car (continuously increasing), whereas GAUGE may be compared to the speed (showing the actual data when querying), You may consult http://www.rrdtool.org for more precise description
Reinhard
Re: Custom SNMP oid
I'm having the same problem, but i'm trying to graph a a Windows mount poit partition.
I use a script to retrieve the total,used and free space (ech one with one OID) , that works fine with snmpwalk (returns in a string too).
I tried to use SNMP - Generic OID datasource and graph template, but it doesn't work. I created a custom datasource template with SNMP Get for each OID, but in both graph it shows the value -1.#J.
I can't find a template that get Windows mout point values.
Someone knows how I can graph it?
Thanks in advance.
I use a script to retrieve the total,used and free space (ech one with one OID) , that works fine with snmpwalk (returns in a string too).
I tried to use SNMP - Generic OID datasource and graph template, but it doesn't work. I created a custom datasource template with SNMP Get for each OID, but in both graph it shows the value -1.#J.
I can't find a template that get Windows mout point values.
Someone knows how I can graph it?
Thanks in advance.
- Rafael -
\|/
.|
\|/
.|
Who is online
Users browsing this forum: No registered users and 1 guest