masterzen / mysql-snmp

Net-SNMP perl agent for monitoring MySQL servers
http://www.masterzen.fr/software-contributions/mysql-snmp-monitor-mysql-with-snmp/
GNU General Public License v2.0
67 stars 33 forks source link

Another: MYSQL-SERVER-MIB::enterprises.20267 = No more variables left in this MIB View (It is past the end of the MIB tree) #4

Closed Iamu closed 14 years ago

Iamu commented 14 years ago

is there error I get in response to issuing - just like the other issue.

snmpwalk -m MYSQL-SERVER-MIB -v 2c -c public localhost enterprises.20267

Please help me learn something here so I don't have to bug peolple with such issues. I will try to include what I believe is relevant based on the previous issue of the same nature. I am working on learning what I can about SNMP and OpenNMS and this nifty mysql-snmp tool. My concerns are that this isn't installed correctly and I am not sure how to verify the install via RPM build/install I did. (Used to do Debian pkging but aside from basic install/query/update commands RMP packaging is a newer beast to me). Finally, how it becomes incorporated into OpenNMS when it is in fact installed and working correclty and how this will translate when I use it remotely (prob. be fine once it is installed correctly.) Can snmpv3 be used with mysql-snmp? Alrighty, any words from the wiser? Here's the info:

Using FC12 64-bit net-snmp fo x86_64 5.4.2.1 is installed

Attempted to build rpm of mysql-snmp and it seems as though it built correctly and installed.

rpm --query mysql-agent

mysql-agent-1.0rc1-2.fc12.noarch see mib installed in /etc

Ran into and cleaned up various lib dependency issues running this on the command line:

mysql-agent -h localhost -u root -p -i -v

now it runs and there is no output/errors to command line running in non-daemon mode (see output at the end of this email...)

Added master agentX to snmpd.conf Uncertain about what it is to add an view for enterprise - attempted it a few times but got error in /var/log/messages on snmpd.conf restart. While I successfully set up snmpv3 to work with cacti, I am not an expert, doing snmpV3 I didn't have to to a lot of work in the snmpd.conf file so I may be a bit confused here about adding this. Finally, yes, made sure to restart snmp after any snmpd.conf revisions.

snmpd.conf (just using defaults for now to test it out - would like to implement in snmpv3

if possible)

master agentx

First, map the community name "public" into a "security name"

sec.name source community

com2sec notConfigUser default public

Second, map the security name into a group name:

groupName securityModel securityName

group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser

Third, create a view for us to let the group have rights to:

Make at least snmpwalk -v 1 localhost -c public system fast again.

name incl/excl subtree mask(optional)

view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.2.1.25.1.1

OUTPUT: /var/log/messages (looks good and then it doesn't...?!?!)

Turning on AgentX master support. Jun 21 15:35:54 localhost snmpd[13665]: NET-SNMP version 5.4.2.1 Jun 21 15:36:09 localhost snmpd[13665]: netsnmp_assert !"registration != duplicate" failed agent_registry.c:536 netsnmp_subtree_load()

OUTPUT: $ mysql-agent -h localhost -u root -p -i -v --no-daemon

NET-SNMP version 5.4.2.1 AgentX subagent connected registering pdu failed: 263! mysql-agent[13995]: enterprises.20267.200.1.1.0 -> myKeyReadRequests enterprises.20267.200.1.1.0 -> myKeyReadRequests mysql-agent[13995]: enterprises.20267.200.1.2.0 -> myKeyReads enterprises.20267.200.1.2.0 -> myKeyReads mysql-agent[13995]: enterprises.20267.200.1.3.0 -> myKeyWriteRequests enterprises.20267.200.1.3.0 -> myKeyWriteRequests mysql-agent[13995]: enterprises.20267.200.1.4.0 -> myKeyWrites enterprises.20267.200.1.4.0 -> myKeyWrites mysql-agent[13995]: enterprises.20267.200.1.5.0 -> myHistoryList enterprises.20267.200.1.5.0 -> myHistoryList mysql-agent[13995]: enterprises.20267.200.1.6.0 -> myInnodbTransactions enterprises.20267.200.1.6.0 -> myInnodbTransactions mysql-agent[13995]: enterprises.20267.200.1.7.0 -> myReadViews enterprises.20267.200.1.7.0 -> myReadViews mysql-agent[13995]: enterprises.20267.200.1.8.0 -> myCurrentTransactions enterprises.20267.200.1.8.0 -> myCurrentTransactions mysql-agent[13995]: enterprises.20267.200.1.9.0 -> myLockedTransactions enterprises.20267.200.1.9.0 -> myLockedTransactions mysql-agent[13995]: enterprises.20267.200.1.10.0 -> myActiveTransactions enterprises.20267.200.1.10.0 -> myActiveTransactions mysql-agent[13995]: enterprises.20267.200.1.11.0 -> myPoolSize enterprises.20267.200.1.11.0 -> myPoolSize mysql-agent[13995]: enterprises.20267.200.1.12.0 -> myFreePages enterprises.20267.200.1.12.0 -> myFreePages mysql-agent[13995]: enterprises.20267.200.1.13.0 -> myDatabasePages enterprises.20267.200.1.13.0 -> myDatabasePages mysql-agent[13995]: enterprises.20267.200.1.14.0 -> myModifiedPages enterprises.20267.200.1.14.0 -> myModifiedPages mysql-agent[13995]: enterprises.20267.200.1.15.0 -> myPagesRead enterprises.20267.200.1.15.0 -> myPagesRead mysql-agent[13995]: enterprises.20267.200.1.16.0 -> myPagesCreated enterprises.20267.200.1.16.0 -> myPagesCreated mysql-agent[13995]: enterprises.20267.200.1.17.0 -> myPagesWritten enterprises.20267.200.1.17.0 -> myPagesWritten mysql-agent[13995]: enterprises.20267.200.1.18.0 -> myFileFsyncs . .(more of the same above, omitted for brevity) . enterprises.20267.200.1.143.0 -> myThreadHashMemory mysql-agent[13995]: Setting error to 0 Setting error to 0 mysql-agent[13995]: Refreshed at 1277149220 0 Refreshed at 1277149220 0 $VAR1 = { 'myPendingLogWrites' => { 'value' => 0, 'type' => 'Gauge32' }, 'myStateWritingToNet' => { 'value' => 0, 'type' => 'Gauge32' . . (more of the same above, omitted for brevity) . } };

mysql-agent[13995]: not refreshing: 15 < 300 not refreshing: 15 < 300 mysql-agent[13995]: not refreshing: 30 < 300 not refreshing: 30 < 300 mysql-agent[13995]: not refreshing: 45 < 300 not refreshing: 45 < 300 mysql-agent[13995]: not refreshing: 60 < 300 not refreshing: 60 < 300 mysql-agent[13995]: not refreshing: 75 < 300 not refreshing: 75 < 300 mysql-agent[13995]: not refreshing: 91 < 300 not refreshing: 91 < 300 mysql-agent[13995]: not refreshing: 106 < 300 not refreshing: 106 < 300 mysql-agent[13995]: not refreshing: 121 < 300 not refreshing: 121 < 300 mysql-agent[13995]: not refreshing: 136 < 300 not refreshing: 136 < 300 . . (more of the same above, omitted for brevity)

.

END

Iamu commented 14 years ago

Hmmm, I see that some of the formatting I used within the original text got very screwed up. I do apologize for that. If you need me to re-enter please let me know...

Thank you, Iamu

Iamu commented 14 years ago

Yep, working this issue like a dog with a bone... Finally did more snmp.conf research. I decided to add these lines and restarted snmpd without error....

view enterprise included .1.3.6.1.4.1 view all included .1

Tried both one at a time, and the result is still the same error message I am trying to correct. Additionally, I am seeing that I can start/stop the status of mysql-agent.

service mysql-agent start/stop

Thx.

Iamu commented 14 years ago

OK, so I am answering most of my own questions. I have made the leap of installing the datacollection and graph properties. Still uncertain how to set these views/graphs up in Opennms but I ran through the install instructions from top to bottom and Opennms is still functioning. At this point, this would all be ready to go with the exception the SNMPWALK command is still giving me the original error as discussed above (and the fact that I am not sure where in the OpenNMS interface these graphs get set but I am not sure if I am not seeing it b/c SNMP isnt able to collect the mysql enterprise info via the MYSQL-SERVER MIB used herein).

I realize it is summer and lots of people are on vacationa and if they are not then peeps are busy... I get it so I don't mean to be updating this as an indication of impatience rather just showing that I am working to solve my issues where I can. Pretty please, is there any input your or anyone can offer to clear this up?

Thx, Iamu

Iamu commented 14 years ago

Well, well, well. I decided to completely scrap my SNMP configuration, saved the files off to a new name and reran snmpconf. It simplified the snmpd.conf file to a few lines and I am now getting successful results when running snmp. It also looks like I have the graphs up and running in the opennms UI! HooRAY!

Well, I thank you for listening, even if the listening was happening in stuffed teddy bear mode. Although, I never believed it until now, I heard about this type of listening mode being a viable method to find solutions in Tim Limoncelli's book on SA Time Mgmt. Apparently, sometimes in talking out solutions it really doesn't matter if anyone is listening - as it just serves to slow you down enough to take your thinking to a more step by step pace.

Thx, again! Iamu

masterzen commented 14 years ago

I'm happy you solved your issue. And yes you are correct, sometimes expressing the issue verbally is enough to find the problem :-) Let me know if you need assistance from me :-) Brice

Iamu commented 14 years ago

Hey Brice!

Good to know you are out there! As a matter of fact I believe I do need further assistance on the following item.

The first instance I got up and running of mysql-snmp was on the same server as OpenNMS. My next step was to get OpenNMS configured to reach out to a mysql db that was remote to the OpenNMS server. It isn't simply a matter of installing the MYSQL-SERVER-MIB.txt on the remote server is it? Are there other steps? That is what the mysql-agent is all about, eh? Why would the mysql-agent need to be installed on the remote. Wouldn't this all be configured via OpenNMS? Additionally, the remote server is using SNMPv3.

So far I installed MIB.txt on server. Added MIBS +ALL to snmp.conf, restarted snmpd and when I try a couple tests this is what is happening.

I do get successful results using a standard MIB...

snmpget -v 3 -u mysec_userV3 -l myauth -a MD5 -A myauthpass -x DES -X myprivphrase 192.168.x.x sysUpTime.0

DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (164925) 0:27:29.25 03:39:55 PM

But when I do it for MYSQL-SERVER-MIB

snmpget -v 3 -u mysec_userV3 -l myauth -a MD5 -A myauthpass -x DES -X myprivphase 192.168.x.x MYSQL-SERVER-MIB::myStatus

MYSQL-SERVER-MIB::myStatus = No Such Object available on this agent at this OID

The same thing happens if I sub enterprises.20267 for MYSQL-SERVER-MIB::myStatus but get MYSQL-SERVER-MIB::enterprises.20267 = No Such Object available on this agent at this OID .

Here is some output from running the mysql-agent from the OpenNMS host targeting the remote host...

mysql-agent -h 192.168.x.x -u remotedbUname -p password -i -v --no-daemon NET-SNMP version 5.4.2.1 AgentX subagent connected registering pdu failed: 263! mysql-agent[31879]: enterprises.20267.200.1.1.0 -> myKeyReadRequests enterprises.20267.200.1.1.0 -> myKeyReadRequests mysql-agent[31879]: enterprises.20267.200.1.2.0 -> myKeyReads

: : ysql-agent[31879]: not refreshing: 45 < 300 not refreshing: 45 < 300 mysql-agent[31879]: not refreshing: 60 < 300 not refreshing: 60 < 300 mysql-agent[31879]: not refreshing: 75 < 300 not refreshing: 75 < 300 mysql-agent[31879]: not refreshing: 90 < 300 not refreshing: 90 < 300 mysql-agent[31879]: not refreshing: 105 < 300 not refreshing: 105 < 300

Any thing you can offer to help clear up my confusion would be great as I am a bit turned around in this.

Again, if you want me to open this under a separate issue, please let me know... Thx, Iamu

masterzen commented 14 years ago

You can run the mysql-snmp agent wherever you want (provided the server runs a net-snmp daemon). Usually it is best to run it on the same host as the mysql server, because your NMS will monitor the service on the same host (otherwise your mysql agent is available on another ip/host than the real service).

You don't need to have the mib, except if you use the command-line client (ie any snmpget/walk) and you want the oid to be translated to their names.

OpenNMS (if configured properly with the files I provide), will automatically know the oids it should fetch and their names.

The error you get when running your snmpget command is because the remote host you're querying doesn't run a mysql-agent. Issue the same command to the snmpd that runs a mysql-snmpd and it should work. So far, I think AgentX protocol only works on unix sockets so it isn't possible to separate mysql-snmp from net-snmp daemon.

Hope it is more clear now. Do not hesitate to ping me (I'm masterzen in #opennms on freenode) if you need anything.

Brice

Iamu commented 14 years ago

On the remote machine:

net-snmp 5.3.2.2.9.el5_5.1 perl v5.8.8

I tried to find net-snmp 5.4 via yum but nothing and looked around for RPMs but the ones that I found are for FC. I believe this is a CentOS machine. So if it isn't necessary to upgrade to next versions that would be nice.

My concern is that something with the MYSQL-SERVER-MIB isn't fully loaded on the remote host and that my configurations are out of wack on the OpenNMS host and possibly missing on the remote host. Do I need to do more to my.cnf file that is on the OpenNMS host? I am able to both locally (be on the remote host) and also remotely connect via command line from the OpenNMS host and issue

snmpget -v 3 -u mysec_userV3 -l myauth -a MD5 -A myauthpass -x DES -X myprivphrase 192.168.x.x sysUpTime.0

and get a successful response.

So, it is clear that the user name and password are working fine. Is there further SNMP auth needed for v3 for enterprise? I didn't think so nor could I find anything.

Unfortunately, I am afraid on this one I am really stuck on this one...thoughts?