Cannot Remove MIB
Cannot Remove MIB
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
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
It might also be listed in /usr/share/snmp/mibs/processed_mibs/.
Former Nagios employee
Re: Cannot Remove MIB
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
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
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Cannot Remove MIB
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.
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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Cannot Remove MIB
I don't believe so.Could they be located somewhere else?
Can you run the following commands and show us the output?
Code: Select all
ls -lad /usr/share/snmp/mibs
grep nag /etc/groupBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot Remove MIB
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
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
nagcmd
David
Re: Cannot Remove MIB
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.
Code: Select all
chmod g+ws /usr/share/snmp/mibsBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot Remove MIB
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
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
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot Remove MIB
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
[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