项目作者: SNapier

项目描述 :
Nagios Library in PHP to monitor VMware NSX Devices via VMware API
高级语言: PHP
项目地址: git://github.com/SNapier/NSXMon.git
创建时间: 2019-06-17T07:16:43Z
项目社区:https://github.com/SNapier/NSXMon

开源协议:GNU General Public License v3.0

下载


NSXMon

Nagios Library to monitor VMware NSX Devices

Command Line

Usage: /usr/bin/php NSXMon.php -H ““ -f “/path/to/authfile.cfg” -m ““ -a ““ -c ““ -C ““ -O ““ -s ““ -n “

NagiosXI Command

Name: NSXMon

/usr/bin/php -q $USER1$/NSXMon.php -H “$HOSTADDRESS$” -f “$ARG1$” -m “$ARG2$” -a “$ARG3$” -c “$ARG4$” -C “$ARG5$” -O “$ARG6$” -s “$ARG7$” -n “$ARG8$”

Auth File

  1. pass the full path to the file in $ARG1 of the check command.
  2. See auth-file-example,cfg for content and format requirements

NSXMon Check Options

  1. SYSTEM
  2. -m | --monitor (system)
  3. -a | --action system(uptime, version, cpu-usage, cpu-count, cpu-cap, mem-usage, mem-total, storage-usage, storage-total)
  4. -c | --critcal
  5. -n | --negate (default is false) - forces check to exit with OK state
  6. SYSTEM-EVENT
  7. -m | --monitor* (system-event)
  8. -a | --action* system-event(show-crit, show-high)
  9. -c | --critcal* (eventId to match against)
  10. -C | --criticalcount (The number of number of matched events before alert)
  11. -O | --criticalobject (Specific origin objectId to match against)
  12. -s | --scanrange (Only scan events newer than the last X seconds) - seconds only
  13. -n | --negate (default is empty\false) - forces check to exit with OK state
  14. SYSTEM-ALARM
  15. -m | --monitor* (system-alarm)
  16. -a | --action* system-event(show-resolvable, show-unresolvable)
  17. -c | --critcal ()
  18. -C | --criticalcount (The number of number of matched events before alert) default = 1
  19. -O | --criticalobject (Specific alarm objectId to match against)
  20. -s | --scanrange (Only scan events newer than the last X seconds) - default = 600
  21. AUDIT-LOG
  22. -m | --monitor (audit-log)
  23. -a | --action audit-log(show-fail)
  24. -c | --critcal
  25. -C | --criticalcount (The number of number of matched events before alert) -> default = 1
  26. -O | --criticalobject (Specific operation type to match against)
  27. -s | --scanrange (Only scan events newer than the last X seconds) - default = 600
  28. SNMP
  29. -m | --monitor (snmp)
  30. -a | --action snmp(list-all, list-enabled, trap-info)
  31. -c | --critcal

Service Check Examples

SHOW-CRITICAL-SYSTEM-EVENTS

/usr/bin/php -q NSXMon.php -H “yourhostname” -f “/usr/local/nagios/libexec/nsxmgrauthfile.cfg” -m “system-event” -a “show-crit” -c “1” -w “0” -n “” -x “0”

SHOW-RESOLVABLE-SYSTEM-EVENTS

/usr/bin/php -q NSXMon.php -H “yourhostname” -f “/usr/local/nagios/libexec/nsxmgrauthfile.cfg” -m “system-alarm” -a “show-resolvable” -c “” -C “5” -O “” -s “” -n “”

MEM-USAGE (CRITICAL > 95%)

/usr/bin/php -q NSXMon.php -H “yourhostname” -f “/usr/local/nagios/libexec/nsxmgrauthfile.cfg” -m “system” -a “mem-usage” -c “95” -C “” -O “” -s “” -n “”

VMware Setup

  1. Create Read-Only user via the API with full permissions to the API.
  2. Use this username and password in the auth file.