Page 1 of 2
Cannot Remove MIB
Posted: Mon Nov 10, 2014 10:21 am
by perric
Hello,
I am running Nagios XI 2012R2.9. I am unable to remove the MIB from the GUI. It says "MIB delete failed - directory permissions may be incorrect."
I have completed the following commands, but this doesn't help. There appears to be another place, where I need to remove the "converted MIB".
chown -R root:nagios /usr/share/snmp/mibs
chmod 664 /usr/share/snmp/mibs/*
Directory Listing after chmod/chown commands (partial):
[root@cawlk mibs]# ls -al
total 2308
drwxr-xr-x. 2 root nagios 4096 Nov 10 10:08 .
drwxr-xr-x. 5 root root 4096 Nov 6 11:49 ..
-rw-rw-r-- 1 root nagios 17455 Oct 21 04:37 AGENTX-MIB.txt
-rw-rw-r-- 1 root nagios 50948 Oct 21 04:37 BRIDGE-MIB.txt
-rw-rw-r-- 1 root nagios 31276 Nov 7 12:44 CISCO-CONFIG-MAN-MIB-V1SMI.my
-rw-rw-r-- 1 root nagios 4186 Nov 7 11:05 CISCO-GENERAL-TRAPS.my
-rw-rw-r-- 1 root nagios 12283 Nov 10 10:08 CISCO-ISDN-MIB-V1SMI.my
If I delete the MIB (CISCO-ISDN-MIB-V1SMI.my) manually with rm command from /usr/share/snmp/mibs folder and then copy the MIB back, I get the following message with the addmib command:
[root@cawlk mibs]# addmib /usr/share/snmp/mibs/CISCO-ISDN-MIB-V1SMI.my
This file looks like it has been added already! Exiting.
How can I fully remove the MIB, once it has been installed?
David
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 2:05 pm
by tmcdonald
It might also be listed in /usr/share/snmp/mibs/processed_mibs/.
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 3:09 pm
by perric
Hi,
I checked the /usr/share/snmp/mibs folder and there are no sub-folders. I did a find for processed_mibs and it didn't find anything.
Could they be located somewhere else?
David
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 3:23 pm
by sreinhardt
Depending on what version of addmib and XI you have, it could be in a few places. However I want to point out that the delete mib function will only remove from /usr/share/snmp/mibs/ and no where else. So when you see the mib in the webui, this is the directory it is displaying them from. That said, I just confirmed on my system with the same permissions that through the webui, as nagios and apache from cli, I can consistently add, remove, and modify mibs in the proper directory. The simplest route is to remove it from the shell, as you already have access. To properly fix it though, I would suggest we check the apache error log and see if anything happens when you try and remove it.
tail -f /var/log/httpd/error_log
[attempt to remove a mib from the webui]
ctrl+c to cancel the tail command.
Paste the output back here so we can take a look.
Also on your system, it looks like addmib would be adding them to /etc/snmp/snmptt.conf, you can check for other included files in the very bottom of /etc/snmp/snmptt.ini.
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 3:32 pm
by lmiltchev
Could they be located somewhere else?
I don't believe so.
Can you run the following commands and show us the output?
Code: Select all
ls -lad /usr/share/snmp/mibs
grep nag /etc/group
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 4:05 pm
by perric
Here are responses to the two questions...
sreinhardt: When I ftp the MIB files onto the server, I believe the permissions are restricted and then the following "Permission Denied" message may be occuring when I run the addmib command.
[root@cawlk mibs]# tail -f /var/log/httpd/error_log
/usr/share/snmp/mibs/ISDN-MIB-V1SMI.my: Permission denied
No log handling enabled - turning on stderr logging
/usr/share/snmp/mibs/ISDN-MIB-V1SMI.my: Permission denied
No log handling enabled - turning on stderr logging
/usr/share/snmp/mibs/OLD-CISCO-INTERFACES-MIB.my: Permission denied
/usr/share/snmp/mibs/OLD-CISCO-SYS-MIB.my: Permission denied
/usr/share/snmp/mibs/CISCO-SMI-V1SMI.my: Permission denied
/usr/share/snmp/mibs/OLD-CISCO-SYSTEM-MIB.my: Permission denied
/usr/share/snmp/mibs/OLD-CISCO-TS-MIB.my: Permission denied
/usr/share/snmp/mibs/OLD-CISCO-TCP-MIB.my: Permission denied
^C
For the include files, let me know what section you want me to send. I didn't see anything in particular labelled "include", but it's possible that I missed it.
lmiltchev: [root@cawlk mibs]# ls -lad /usr/share/snmp/mibs
drwxr-xr-x. 2 root nagios 4096 Nov 10 15:38 /usr/share/snmp/mibs
[root@cawlk mibs]# grep nag /etc/group
nagios

501:nagios,apache,snmptt
nagcmd

502:nagios,apache,snmptt
David
Re: Cannot Remove MIB
Posted: Mon Nov 10, 2014 5:30 pm
by lmiltchev
The permissions of the "/usr/share/snmp/mibs" directory don't look correct. Let's try running:
Then try to delete a MIB from the web UI again and see if you are going to get the same error.
Re: Cannot Remove MIB
Posted: Tue Nov 11, 2014 9:36 am
by perric
Thanks. The chmod now allows me to delete MIBS from the "Manage MIBs" section of the GUI.
When I try to delete and re-add a MIB file, it seems that a "processed" or "converted" MIB is still in place somewhere else, even though I have deleted the MIB file and placed a new one into /usr/share/snmp/mib folder. See addmib message below:
[root@cawlk mibs]# addmib /usr/share/snmp/mibs/CISCOTRAP-MIB.my
This file looks like it has been added already! Exiting.
David
Re: Cannot Remove MIB
Posted: Tue Nov 11, 2014 12:48 pm
by lmiltchev
Did you add the MIB in the GUI, prior to running the "addmib" command from the CLI? Can you describe exactly what you did so that we can try to recreate the issue in house? Thanks!
Re: Cannot Remove MIB
Posted: Tue Nov 11, 2014 4:55 pm
by perric
This is my procedure to add the mib...
[root@cawlk snmptt]# cd /usr/share/snmp/mibs
[root@cawlk mibs]# ftp hkl101
Connected to hkl101 (192.168.200.10).
220 Microsoft FTP Service
Name (hkl101:root): talone
331 Password required for talone.
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> get CISCOTRAP-MIB.my
local: CISCOTRAP-MIB.my remote: CISCOTRAP-MIB.my
227 Entering Passive Mode (192,168,200,10,247,230).
125 Data connection already open; Transfer starting.
226 Transfer complete.
4286 bytes received in 0.000236 secs (18161.02 Kbytes/sec)
ftp> bye
221 Goodbye.
[root@cawlk mibs]# ls -al CISCOTRAP-MIB.my
-rw------- 1 root nagios 4186 Nov 11 16:51 CISCOTRAP-MIB.my
[root@cawlk mibs]# addmib /usr/share/snmp/mibs/CISCOTRAP-MIB.my
This file looks like it has been added already! Exiting.
[root@cawlk mibs]#
David