Skip to content

Commit

Permalink
Include snmp in plugins diagnostic. (#247)
Browse files Browse the repository at this point in the history
(cherry picked from commit aa6d7b6)

Co-authored-by: Mark Grimes <[email protected]>
  • Loading branch information
bugclerk and mgrimesix authored Nov 19, 2024
1 parent 5bfd299 commit 3d48030
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 @@ -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
Expand Down Expand Up @@ -66,6 +67,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 3d48030

Please sign in to comment.