Skip to content

Commit

Permalink
Include snmp in plugins diagnostic.
Browse files Browse the repository at this point in the history
(cherry picked from commit aa6d7b6)
  • Loading branch information
mgrimesix authored and bugclerk committed Nov 16, 2024
1 parent 5a694be commit 92ebc66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ixdiagnose/plugins/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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
Expand Down Expand Up @@ -64,6 +65,7 @@
Services,
SMART,
SMB,
SNMP,
SSL,
Sysctl,
System,
Expand Down
22 changes: 22 additions & 0 deletions ixdiagnose/plugins/snmp.py
Original file line number Diff line number Diff line change
@@ -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'),
]

0 comments on commit 92ebc66

Please sign in to comment.