Translations of this page:

Zusatz-Module (Contribution)

Alle Dateien dieser Seite sind auch Bestandteil des check_multi-Tree und damit in den Tarballs enthalten.

notify_service.html

Diese Datei kann als Ersatz fuer die Standard-Notification dienen, es versendet den HTML extended plugin output als Mail-Attachment.

  1. Achtung: dafuer benoetigt man eine spezielle Version des mailx, die mit Attachments von der Kommandozeile umgehen kann.
  2. Bitte beide Dateien ins libexec Directory kopieren
  3. Dann den entsprechenden notify-service-by-email-Eintrag in der commands.cfg ersetzen durch die folgenden Zeilen:
    # 'notify-service-by-email' command definition 
    define command {
      command_name         notify-service-by-email
      command_line         /bin/sh /usr/local/nagios/libexec/notify_service_html
    }
  4. Das Script arbeitet nicht mit Kommandozeilen-Variablen, sondern stattdessen mit den Nagios Environment-Variablen, die daher auch in der nagios.cfg eingeschaltet sein muessen:
    enable_environment_macros=1

Beispiel Mailoutput (die alte Version, wird hoffentlich bald updated ;-)):

Nagios service notification
PROBLEM check_multi test WARNING
Sun Aug 5 16:33:23 CEST 2007

--- Host information ---
Name                   thinkpad
IP address             127.0.0.1

--- Service information ---
Name                   check_multi test
State                  WARNING
State type             HARD
Output                 SYSTEM WARNING - 15 plugins checked, 0 critical (), 1 warning (disk_root_warning), 0 unknown (), 14 ok

WARNING service output
[15] WARNING disk_root_warning - DISK WARNING - free space: / 4876 MB (42% inode=82%);

OK service output
[ 1] OK proc_cron - PROCS OK: 1 process with command name 'cron'
[ 2] OK proc_syslogd - PROCS OK: 1 process with command name 'syslog-ng'
[ 3] OK proc_xinetd - PROCS OK: 1 process with command name 'xinetd'
[ 4] OK procs_RSS - RSS OK: 136 processes
[ 5] OK procs_zombie - PROCS OK: 1 process with STATE = Z
[ 6] OK system_load - OK - load average: 0.53, 1.20, 1.72
[ 7] OK system_mail - TCP OK - 0.015 second response time on port 25
[ 8] OK system_mailqueue - OK: mailq is empty
[ 9] OK system_ntp - NTP OK: Offset 10.86617522 secs
[10] OK system_portmapper - OK: RPC program portmapper version 2 udp running
[11] OK system_rootdisk - DISK OK - free space: / 4876 MB (42% inode=82%);
[12] OK system_ssh - SSH OK - OpenSSH_4.4 (protocol 1.99)
[13] OK system_swap - SWAP OK - 97% free (1978 MB out of 2048 MB) 
[14] OK system_syslog - FILE_AGE OK: /var/log/messages is 1 seconds old and 6943224 bytes

Plugin                 check_multi!/usr/local/nagios/etc/check_multi.cmd
Execution time(s)      1.248

--- Contact information ---
Name                   nagiosadmin
Alias                  Nagios Admin
Mail address           Matthias.Flacke@gmx.net
Notification type      PROBLEM

--- Service URLs ---
Service details        http://localhost/nagios/cgi-bin/extinfo.cgi?type=2&host=thinkpad&service=check_multi test
Service alert history  http://localhost/nagios/cgi-bin/history.cgi?host=thinkpad&service=check_multi test
Service availability   http://localhost/nagios/cgi-bin/avail.cgi?host=thinkpad&&service=check_multi test&show_log_entries
Service comments       http://localhost/nagios

--- Host URLs ---
Host details           http://localhost/nagios/cgi-bin/extinfo.cgi?type=1&host=thinkpad
Host services          http://localhost/nagios/cgi-bin/status.cgi?host=dada
Host alert history     http://localhost/nagios/cgi-bin/history.cgi?host=thinkpad
Host availability      http://localhost/nagios/cgi-bin/avail.cgi?host=thinkpad&show_log_entries
Host comments          http://localhost/nagios

status_query.cgi

Momentan gibt es die status_query.cgi nur in einer der Entwicklerversionen unter contrib/status_query. Das CGI per make erstellen und ins Nagios-CGI-Verzeichnis kopieren, das normalerweise in <nagiosdir>/sbin liegt.

Das CGI-Script bietet ein flexibles Interface, um verschiedene Felder in der status.dat abzufragen und die Ergebnisse in einer Tabelle zu praesentieren, die der status.cgi aehnelt.

de/projects/check_multi/contributions.txt · Zuletzt geƤndert: 2010/01/30 12:36 von flackem
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0