-
-
Notifications
You must be signed in to change notification settings - Fork 90
Maintenance Scripts
nick n edited this page May 15, 2021
·
11 revisions
These are listed roughly in the order that you'd run them in a standard workflow.
Run everything from a git clone, setting
MIBHOME
environment variable to that location.
- Builds the net-snmp applications with an amended
MAXTC
so that all MIBs can be loaded at once, needed for versions older as net-snmp 5.8- in net-snmp 5.8 the default maxtc is 16k, just like Alien::SNMP::MAXTC does.
- net-snmp 5.9 is currently not supported yet.
- Spawns your shell with
PATH
adjusted to use these applications (exit
to quit the shell)
- Triggers net-snmp to build index files for netdisco-mibs (in a temporary location)
- Caches those indexes in a portable way (removing your system's directories)
- Writes
mib_index2.txt
file containing all vendor MIBs and their files - Changes files in the git repo
- Organises files in new_mibs_dir (presumably a messy vendor bundle) in preparation for import
- Renames any known MIB file to be the same as its equivalent in netdisco-mibs
- Prints a friendly report telling you about all actions taken:
- Files that don't look like MIBs (to net-snmp) are moved to the "skip" subfolder
- Files that seem to have issues are moved to the "error" subfolder
- MIBs belonging to other vendors are moved to "other/vendorname" subfolder(s)
- MIBs older than their equivalent in netdisco-mibs are moved to the "older" subfolder
- MIBs the same age as in netdisco-mibs are moved to the "same" subfolder
- Copies files from new_mibs_dir to the vendor's folder in netdisco-mibs
- Assumes that prepmibs has been run, so only new and newer MIBs are in new_mibs_dir
- Refuses to run if the "error" subfolder has anything in it
- Changes files in the git repo
- Run
snmptranslate
on each MIB in a vendor's folder (individually), report errors
- Run
snmptranslate
on all MIBs in netdisco-mibs (at once), report errors - A tree-form report of the loaded MIBs and their content (
-Tt
) is saved toMIBHOME/extras/reports/all
- genxlate is dependend on file system specific file ordering, which can sometimes lead to cosmetic
differences in reports.
- see https://github.com/netdisco/netdisco-mibs/issues/104 for more info.
- Changes files in the git repo
- Given any MIB file, runs a diff against the equivalent MIB in netdisco-mibs
- Reports if any two files are defining the same MIB. Shows a diff and LAST-UPDATED, if they are
- Needs a mib_index.txt file containing .index from all directories in the bundle
- runs snmptranslate on every MIB file listed in a .index and dies if there are errors
- Needs a .index file for the directory
- Runs chk_mibs for the directories in cwd
- Runs snmptranslate with
-M$dir
to prompt it to regenerate the .index file for$dir
- Builds a mib_index.txt from the sorted content of all the .index files
- Copies .index files from the net-snmp PERSISTENT_DIR system cache back into local directories
- Strips the DIR line that is added since net-snmp moved from dotfiles to persistent cache
- Dump the contents of a MIB on a device
- Can also run in a dumb snmpwalk mode from the root(s) in the MIB
- Runs snmpwalkmib on all MIBs mentioned in a mib_index.txt or .index file
- Compares two directories and makes sure one contains the newest (or only) versions of all files
- Renames a file name to lowercase (I suppose if you don't have
rename
)