[SERVER-6595] Improvement and clarification of errors/warnings that can arise when starting Enterprise Mongod with SNMP enabled Created: 25/Jul/12  Updated: 08/Mar/13  Resolved: 10/Jan/13

Status: Closed
Project: Core Server
Component/s: Admin, Networking
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Mark porter Assignee: Mark porter
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:

 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



 Comments   
Comment by Mark porter [ 10/Jan/13 ]

The main issue regarding cases 1 and 2 is that they are different issues but have the same error, the error message should differentiate between the two issues and also be more informational.

Agreed that the MIB is used by the client to retrieve information and so not needed by mongod. Please disregard, not sure what I was on about.

Comment by Eliot Horowitz (Inactive) [ 10/Jan/13 ]

MIB files are not used by the server at all.
I think case 1 and 2 are probable caused by the same thing, and 3 is not an error at all.

Generated at Thu Feb 08 03:12:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.