All,

Thanks Dave for your help earlier in the week with getting my basic extend
setup correctly. I have enjoyed the (hard road) of learning more about SNMP.
It's been a tough learning curve so far, but I think the understanding will
pay off in a big way. It's got so much potential for my work.

Once I had the basic 'extend' working with a simple "extend datecheck
/bin/date", I went on to the next step which was to add execution of a
local script using 'extend'. I think I'm close to getting this to work, but
have run into a wall. I could really use some more experienced help,
please.

So, I added a script which logs into mysql, checks that the replication
service is running and outputs certain responces based on what it finds.
Running this script locally as 'root' and as a non-privileged user both
return the expected results:

/usr/local/bin/check-mysql-slave.pl --user monitor --pass 'xxxpassword'

returns:

OK - Waiting for master to send event, replicating host 192.168.1.98:3306

This is what is expected, so I feel that I can say the script itself is
working correctly.

When I add this to the snmpd.conf

extend mysql-slave /usr/local/bin/check-mysql-slave.pl --user monitor --pass
'xxxpassword'

restart the snmpd service,

and then run 'snmpgetnext -v2c -c groupzero localhost
NET-SNMP-EXTEND-MIB::nsExtendOutputFull'

I get this back

'NET-SNMP-EXTEND-MIB::nsExtendOutputFull."mysql-slave" = STRING: UNKNOWN -
Connect failed: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13)'

This is the correct location of the mysql.sock file. So, this leads me to
think that the user which is running as snmpd can't access the lock file.
But, upon checking, it seems that the snmpd service is running as root - so
it should have that access.

Any ideas? Thanks in advance for your time!


---------------
Luke Salsich
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to