This shows you the differences between two versions of the page.
public:doku:nagios_icecast [2011/03/20 14:58] ello |
public:doku:nagios_icecast [2014/10/25 18:12] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Icecast mit Nagios überprüfen ===== | ||
- | Als erstes lässt sich natürlich der Icecast mittels check_http überprüfen. | ||
- | Ich habe das mit einer hostgroup gemacht: | ||
- | <file|hostgroups_nagios2.cfg> | ||
- | define hostgroup { | ||
- | hostgroup_name icecast-servers | ||
- | alias ICECAST servers | ||
- | members icecast1,icecast2 | ||
- | } | ||
- | </file> | ||
- | <file|services_nagios2.cfg> | ||
- | define service { | ||
- | hostgroup_name icecast-servers | ||
- | service_description ICECAST on Port 80 | ||
- | check_command check_icecast_http!80 | ||
- | use generic-service | ||
- | notification_interval 0 | ||
- | } | ||
- | </file> | ||
- | |||
- | <file|/etc/nagios-plugins/config/icecast.cfg> | ||
- | #checks if the icecast is accessible via http | ||
- | define command { | ||
- | command_name check_icecast_http | ||
- | command_line /usr/lib/nagios/plugins/check_http -A nagios -H '$HOSTNAME$' -I '$HOSTADDRESS$' -N -p $ARG1$ | ||
- | } | ||
- | </file> | ||
- | |||
- | Andere Ports sind natürlich auch denkbar. | ||
- | Dann sollte man natürlich überprüfen, ob ein mountpoint existiert. | ||
- | Dazu kann man den http-check nehmen und auf eine spezifische url überprüfen. Dabei muss man beachten, mit den Schalter "-N" nach dem Header abzubrechen (der content endet ja theoretisch nie). | ||
- | |||
- | <file|/etc/nagios-plugins/config/icecast.cfg> | ||
- | #check if a url (mountpoint) exists on icecast server | ||
- | define command { | ||
- | command_name check_icecast_mountpoint | ||
- | command_line /usr/lib/nagios/plugins/check_http -A nagios -H '$HOSTNAME$' -I '$HOSTADDRESS$' -N -p $ARG1$ -u '$ARG2$' | ||
- | } | ||
- | </file> | ||
- | |||
- | Denkbar wäre auch eine Mindestlänge des Contents zu überprüfen: | ||
- | <file|/etc/nagios-plugins/config/icecast.cfg> | ||
- | kommt noch | ||
- | </file> | ||
- | |||
- | |||
- | Dann lässt sich noch überprüfen, ob valide Daten vom Icecast kommen | ||
- | <file|/etc/nagios-plugins/config/icecast.cfg> | ||
- | kommt noch | ||
- | </file> | ||
- | |||
- | ==== Beispielhafte Host-Definition ==== | ||
- | Folgende Host-Definition definiert einen Host "icecast1" mit entsprechender ip-addresse. | ||
- | Es werden 2 Mountpoints definiert: /test und /test-fallback. Dabei ist /test-fallback als fallback für /test im icecast definiert. | ||
- | Entsprechende Serviceabhängigkeiten sind wie folgt. | ||
- | |||
- | /test hängt von icecast_http ab | ||
- | /test-fallback hängt von icecast_http ab | ||
- | |||
- | /test hängt nicht von /test-fallback ab, sodas bei Ausfall des fallbacks eine Benachrichtigung kommt, und wenn dann noch /test (auf den es ja ankommt) ausfällt kommt eine zweite Nachricht. | ||
- | |||
- | <file|/etc/nagios3/conf.d/icecast1.cfg> | ||
- | define host{ | ||
- | use generic-host ; Name of host template to use | ||
- | host_name icecast1 | ||
- | alias icecast1.example.com | ||
- | address xxx.xxx.xxx.xxx | ||
- | initial_state o | ||
- | } | ||
- | |||
- | define service { | ||
- | use generic-service | ||
- | service_description mountpoint /test | ||
- | host_name icecast1 | ||
- | check_command check_icecast_mountpoint!80!/test | ||
- | } | ||
- | |||
- | define service { | ||
- | use generic-service | ||
- | service_description mountpoint /test-fallback | ||
- | host_name icecast1 | ||
- | check_command check_icecast_mountpoint!80!/test-fallback | ||
- | } | ||
- | |||
- | define servicedependency { | ||
- | host_name streaming-dunlop | ||
- | dependent_service_description mountpoint /test | ||
- | dependent_host_name icecast1 | ||
- | service_description ICECAST on Port 80 | ||
- | notification_failure_criteria w,u,c | ||
- | } | ||
- | |||
- | define servicedependency { | ||
- | host_name streaming-dunlop | ||
- | dependent_service_description mountpoint /test-fallback | ||
- | dependent_host_name icecast1 | ||
- | service_description ICECAST on Port 80 | ||
- | notification_failure_criteria w,u,c | ||
- | } | ||
- | |||
- | </file> |