diff --git a/ixdiagnose/plugins/factory.py b/ixdiagnose/plugins/factory.py index 105ccc7..96c1770 100644 --- a/ixdiagnose/plugins/factory.py +++ b/ixdiagnose/plugins/factory.py @@ -27,6 +27,7 @@ from .services import Services from .smart import SMART from .smb import SMB +from .snmp import SNMP from .ssl import SSL from .sysctl import Sysctl from .system import System @@ -66,6 +67,7 @@ Services, SMART, SMB, + SNMP, SSL, Sysctl, System, diff --git a/ixdiagnose/plugins/snmp.py b/ixdiagnose/plugins/snmp.py new file mode 100644 index 0000000..ceca261 --- /dev/null +++ b/ixdiagnose/plugins/snmp.py @@ -0,0 +1,22 @@ + +from ixdiagnose.utils.formatter import remove_keys +from ixdiagnose.utils.middleware import MiddlewareCommand + +from .base import Plugin +from .metrics import MiddlewareClientMetric, DirectoryTreeMetric, FileMetric + + +class SNMP(Plugin): + name = 'snmp' + metrics = [ + MiddlewareClientMetric( + 'snmp_config', + [ + MiddlewareCommand('snmp.config', format_output=remove_keys(['v3_password', 'v3_privpassphrase'])), + ] + ), + FileMetric('snmp', '/etc/snmp/snmp.conf', extension='.conf'), + FileMetric('snmpd', '/etc/snmp/snmpd.conf', extension='.conf'), + DirectoryTreeMetric('custom_snmpd', '/etc/snmp/snmpd.conf.d'), + DirectoryTreeMetric('mibs', '/etc/snmp-mibs-downloader'), + ]