Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| — | anwenderwiki:nagios:nagios-sambauser [2013/06/04 23:01] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | {{tag> nagios samba}} | ||
| + | ====== Anzahl der (samba-) User überwachen, | ||
| + | |||
| + | Neue, ausführbare Datei anlegen: **''/ | ||
| + | |||
| + | <code text check_sambausers> | ||
| + | #! /bin/sh | ||
| + | ## / | ||
| + | ## Debian check samba - users | ||
| + | ## | ||
| + | ## benötigt sudo !! | ||
| + | ## | ||
| + | |||
| + | anzahl=`smbstatus -p | wc -l` | ||
| + | if [ " | ||
| + | if [ " | ||
| + | anzahl=$(( $anzahl-4 )) | ||
| + | echo " | ||
| + | exit 0 | ||
| + | else | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | else | ||
| + | echo " | ||
| + | exit 2 | ||
| + | fi | ||
| + | |||
| + | </ | ||
| + | |||
| + | In der Datei **''/ | ||
| + | |||
| + | < | ||
| + | |||
| + | Cmnd_Alias | ||
| + | ... | ||
| + | / | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | |||
| + | Und unter **''/ | ||
| + | |||
| + | <code text sambacommands.cfg> | ||
| + | # Samba-users | ||
| + | # command definitions | ||
| + | define command{ | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | |||
| + | |||
| + | define service{ | ||
| + | use | ||
| + | host_name | ||
| + | service_description | ||
| + | notification_options | ||
| + | check_command | ||
| + | } | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | Schließlich | ||
| + | # service nagios3 restart | ||
| + | |||
| + | |||
| + | |||
| + | Zusätzlich kann man die Userzahl mit dem [[anwenderwiki: | ||
| + | |||
| + | {{: | ||