Hi,

With regards to the MIB I intend to implement in Monit, attached is the
first draft with initial support for monitored processes and files, that
doesn't yet include any of the notification types in it.
See the output of the "monit status" command and the output of an example
snmpwalk against that same monit process.

The MIB itself isn't useful without an IANA assigned private enterprise
number [1]. Is it possible for somebody from Tildeslash to contact IANA and
get a private enterprise number assigned for Monit by filling out this
form: http://pen.iana.org/pen/PenApplication.page ? There's no fee involved,
and while I could do it, I think that the contact details for a private
enterprise number that is registered for Monit should be for Tildeslash and
not myself. I'm currently using a made-up number, which I've replaced with
XXXXXXXX in the attached MIB, but in order to actually use this feature a
real number must be registered.

Comments?

Regards,
Lior

[1] - http://www.iana.org/assignments/enterprise-numbers

---------- Forwarded message ----------
From: Lior Okman
Date: Fri, Sep 2, 2011 at 7:47 AM
Subject: Feature suggestion: SNMP support in Monit

Hi,

It seems to me that Monit is missing the ability to be queried via SNMP
about the state of its monitored services and use SNMP traps or
notifications as alerts.

I'm going to develop support for this, using Net-SNMP's AgentX support with
Monit. Monit would become an SNMP subagent, and if the Net-SNMP snmpd daemon
is running on the same host then the SNMP support would be enable-able.

The RC file would gain one global "set" directive: "set snmp", that would
enable SNMP support in Monit. Setting just this would allow Monit to be
queried about the services it currently has monitored.

Additionally, I am going to change the "alert" statement, so that in
addition to an email you can set a trap or notification OID, and if that
alert is to be triggered, then an appropriate SNMP trap/notification would
be sent. Something along the lines of:

ALERT TRAP oid [ [NOT] {events}] [REMINDER number]

Since Monit would be a subagent, the SNMP specific configuration (community
strings, security settings, etc) would be configured in the local SNMPD
daemon configuration file.

I still haven't got a MIB - more about this later.


Comments?

Regards,
Lior
MONIT::serviceStatus."process1" = INTEGER: running(0)
MONIT::serviceStatus."process2" = INTEGER: running(0)
MONIT::serviceStatus."file1.pid" = INTEGER: running(0)
MONIT::serviceStatus."system_localhost" = INTEGER: running(0)
MONIT::serviceType."process1" = INTEGER: process(3)
MONIT::serviceType."process2" = INTEGER: process(3)
MONIT::serviceType."file1.pid" = INTEGER: file(2)
MONIT::serviceType."system_localhost" = INTEGER: system(5)
MONIT::monitoringStatus."process1" = INTEGER: monitored(1)
MONIT::monitoringStatus."process2" = INTEGER: monitored(1)
MONIT::monitoringStatus."file1.pid" = INTEGER: monitored(1)
MONIT::monitoringStatus."system_localhost" = INTEGER: monitored(1)
MONIT::dataCollected."process1" = Timeticks: (2377) 0:00:23.77
MONIT::dataCollected."process2" = Timeticks: (2371) 0:00:23.71
MONIT::dataCollected."file1.pid" = Timeticks: (2377) 0:00:23.77
MONIT::dataCollected."system_localhost" = Timeticks: (2372) 0:00:23.72
MONIT::pid."process1" = INTEGER: 3665
MONIT::pid."process2" = INTEGER: 19368
MONIT::pid."file1.pid" = INTEGER: 6
MONIT::pid."system_localhost" = INTEGER: 0
MONIT::parentPid."process1" = INTEGER: 3664
MONIT::parentPid."process2" = INTEGER: 1
MONIT::parentPid."file1.pid" = INTEGER: 0
MONIT::parentPid."system_localhost" = INTEGER: 0
MONIT::children."process1" = INTEGER: 0
MONIT::children."process2" = INTEGER: 2
MONIT::children."file1.pid" = INTEGER: 0
MONIT::children."system_localhost" = INTEGER: 0
MONIT::uptime."process1" = Timeticks: (122229800) 14 days, 3:31:38.00
MONIT::uptime."process2" = Timeticks: (45028200) 5 days, 5:04:42.00
MONIT::uptime."file1.pid" = Timeticks: (0) 0:00:00.00
MONIT::uptime."system_localhost" = Timeticks: (0) 0:00:00.00
MONIT::gid."process1" = INTEGER: 0
MONIT::gid."process2" = INTEGER: 0
MONIT::gid."file1.pid" = INTEGER: 0
MONIT::gid."system_localhost" = INTEGER: 0
MONIT::uid."process1" = INTEGER: 0
MONIT::uid."process2" = INTEGER: 0
MONIT::uid."file1.pid" = INTEGER: 0
MONIT::uid."system_localhost" = INTEGER: 0
MONIT::permission."process1" = INTEGER: 0
MONIT::permission."process2" = INTEGER: 0
MONIT::permission."file1.pid" = INTEGER: 33188
MONIT::permission."system_localhost" = INTEGER: 0
MONIT::permission."system_localhost" = No more variables left in this MIB View 
(It is past the end of the MIB tree)

Attachment: MONIT.mib
Description: Binary data

The Monit daemon 5.2.6 uptime: 22m 

File 'file1.pid'
  status                            accessible
  monitoring status                 monitored
  permission                        644
  uid                               0
  gid                               0
  timestamp                         Sun Sep  4 16:40:55 2011
  size                              6 B
  data collected                    Sun Sep  4 16:42:30 2011

Process 'process1'
  status                            running
  monitoring status                 monitored
  pid                               3665
  parent pid                        3664
  uptime                            14d 3h 31m 
  children                          0
  memory kilobytes                  46452
  memory kilobytes total            46452
  memory percent                    4.5%
  memory percent total              4.5%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Sun Sep  4 16:42:30 2011

Process 'process2'
  status                            running
  monitoring status                 monitored
  pid                               19368
  parent pid                        1
  uptime                            5d 5h 4m 
  children                          2
  memory kilobytes                  385616
  memory kilobytes total            444228
  memory percent                    37.6%
  memory percent total              43.4%
  cpu percent                       99.8%
  cpu percent total                 99.8%
  data collected                    Sun Sep  4 16:42:30 2011

System 'system_localhost'
  status                            running
  monitoring status                 monitored
  load average                      [1.00] [1.00] [1.00]
  cpu                               49.5%us 47.8%sy 0.0%wa
  memory usage                      540032 kB [52.7%]
  swap usage                        0 kB [0.0%]
  data collected                    Sun Sep  4 16:42:30 2011

_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to