Re: snmptrapd and mysql

Gilbert Gutierrez <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I disabled SELinux and made some progress. The log then gave me " Error 
1045 (28000): Access denied for user 'root'@'localhost' (using password: 
NO)". The password had to be put into the /etc/my.cnf file. Now it is 
working. I am not sure why SELinux got in the way.

Gilbert

On 1/27/2015 3:49 PM, Gilbert Gutierrez wrote:
> Host is a Centos7 box running everything from pre-compiled...
> net-snmp-5.7.2-18.el7.x86_64
> mariadb-server-5.5.40-2.el7_0.x86_64
>
> Logging to rsyslog works fine but when trying to log via mysql, I get 
> Error 2002, Can't connect to local MySQL server through socket. I have 
> created the datatbase, net_snmp, with the tables notifications and 
> varbinds. Can someone lead me in the correct direction in solving this?
>
> Gilbert
>
>
> snmptrapd.conf:
>
> authCommunity   log     TrapString
>
> # maximum number of traps to queue before forced flush
> # set to 1 to immediately write to the database
> sqlMaxQueue 140
>
> # seconds between periodic queue flushes
> sqlSaveInterval 9
>
>
> /root/.my.cnf:
> [snmptrapd]
> user=root
> password=somepassword
> host=localhost
>
>
>
>
> /var/log/messages
> Jan 27 15:13:50 localhost snmptrapd[2532]: 2015-01-27 15:13:50 
> <UNKNOWN> [UDP: [172.16.6.12]:65534->[172.16.5.140]:162]:
> DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2784535473) 322 
> days, 6:49:14.73      SNMPv2-MIB::snmpTrapOID.0 = OID: 
> SNMPv2-SMI::enterprises.17373.4.1.32767.0.10101 SNMPv2-MIB::sysName.0 
> = STRING: test
> *Jan 27 15:13:51 localhost snmptrapd[2532]: mysql_real_connect() failed**
> **Jan 27 15:13:51 localhost snmptrapd[2532]: Error 2002 (HY000): Can't 
> connect to local MySQL server through socket 
> '/var/lib/mysql/mysql.sock' (13)**
> *Jan 27 15:13:51 localhost snmptrapd[2532]: trap:2015-1-27 
> 15:13:50,TrapString,8,2,1,.1.3.6.1.4.1.17373.4.1.32767.0.10101,UDP: 
> [172.16.6.12]:65534->[172.16.5.140]:162,2,0,0,(null),(null),(null),(null)
> Jan 27 15:13:51 localhost snmptrapd[2532]: 
> varbind:.1.3.6.1.2.1.1.3.0,Timeticks: (2784535473) 322 days, 6:49:14.73
> Jan 27 15:13:51 localhost snmptrapd[2532]: 
> varbind:.1.3.6.1.6.3.1.1.4.1.0,OID: .1.3.6.1.4.1.17373.4.1.32767.0.10101
> Jan 27 15:13:51 localhost snmptrapd[2532]: 
> varbind:.1.3.6.1.2.1.1.5.0,STRING: "test"
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
>
>
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.