Details
-
Improvement
-
Resolution: Incomplete
-
Major - P3
-
None
-
None
-
None
-
Any Supported O/S (i.e. variant of Linux) for Enterprise MongoDB -
$ mongod --version
db version v2.0.6, pdfile version 4.5
Wed Jul 25 11:06:40 git version: e1c0cbc25863f6356aa4e31375add7bb49fb05bc modules: subscription
Description
The first two issues receive the same error in the logs but have a different cause whilst the third issue does not generate any information in the log file.
Resolution of these issue will aide troubleshooting of problem with starting Enterprise mongod with SNMP enabled.
Issue 1 - Start MongoD Enterprise without /etc/snmp/mongod.conf
Check for files -
$ ls /etc/snmp/mongo*
|
ls: cannot access /etc/snmp/mongo*: No such file or directory
|
|
$ ls /usr/share/snmp/mibs/MONGO*
|
/usr/share/snmp/mibs/MONGO-MIB.txt
|
Start mongod with snmp -
$ mongod --snmp-master --fork --logpath /var/tmp/snmp-master.log
|
$ forked process: 6895
|
all output going to: /var/tmp/snmp-master.log
|
mongod does not start and "master err:1" error appears in the log file -
$ egrep -i 'snmp|mib' /var/tmp/snmp-master.log
|
Wed Jul 25 10:06:20 [initandlisten] options: { fork: true, logpath: "/var/tmp/snmp-master.log", snmp-master: true }
|
Wed Jul 25 10:06:20 [SNMPAgent] warning: error starting SNMPAgent as master err:1
|
|
$ sudo lsof -i :1161
|
$
|
Issue 2
Check for files -
$ ls -la /etc/snmp/mongod.conf
|
-rw-r--r--. 1 root root 1392 Jul 3 15:18 /etc/snmp/mongod.conf
|
|
$ ls -la /usr/share/snmp/mibs/MONGO-MIB.txt
|
-rw-r--r--. 1 root root 3658 Jul 3 14:57 /usr/share/snmp/mibs/MONGO-MIB.txt
|
Start netcat on udp port 1161 -
$ nc -l -u 1161 &
|
[1] 7461
|
|
$ sudo lsof -i :1161
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
nc 7461 sysadmin 3u IPv4 35755 0t0 UDP *:health-polling
|
Start mongod with snmp -
$ mongod --snmp-master --fork --logpath /var/tmp/snmp-master.log
|
$ forked process: 7468
|
all output going to: /var/tmp/snmp-master.log
|
and we are able to generate the same error as in the previous issue, however, the cause is different as the socket is not free -
$ egrep -i 'snmp|mib' /var/tmp/snmp-master.log
|
Wed Jul 25 11:47:31 [initandlisten] options: { fork: true, logpath: "/var/tmp/snmp-master.log", snmp-master: true }
|
Wed Jul 25 11:47:32 [SNMPAgent] warning: error starting SNMPAgent as master err:1
|
|
$ sudo lsof -i :1161
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
nc 7461 sysadmin 3u IPv4 35755 0t0 UDP *:health-polling
|
Issue 3
On this occasion no MIB file is present, however, no warning/notification is generated. This is not ideal for troubleshooting -
Check for files -
$ ls -la /usr/share/snmp/mibs/MONGO-MIB.txt
|
ls: cannot access /usr/share/snmp/mibs/MONGO-MIB.txt: No such file or directory
|
|
$ ls -la /etc/snmp/mongod.conf
|
-rw-r--r--. 1 root root 1392 Jul 3 15:18 /etc/snmp/mongod.conf
|
Start mongod with SNMP -
$ mongod --snmp-master --dbpath /data/db/master/ --port 3001 --fork --logpath /var/tmp/snmp-master.log
|
$ forked process: 7210
|
all output going to: /var/tmp/master/1.log
|
The log file shows that the service starts cleanly but there is no warning about a missing MIB file -
$ egrep -i 'snmp|mib' /var/tmp/snmp-master.log
|
Wed Jul 25 11:22:01 [initandlisten] options: { dbpath: "/data/db/master/", fork: true, logpath: "/var/tmp/master/1.log", port: 3001, snmp-master: true }
|
Wed Jul 25 11:22:01 [SNMPAgent] SNMPAgent running as master
|
|
$ sudo lsof -i :1161
|
[sudo] password for sysadmin:
|
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
mongod 7210 sysadmin 9u IPv4 33996 0t0 UDP localhost:health-polling
|