El meu primer Plug-in pel Nagios,
Aquest Plugin serveix per comprobar que una web segura funciona, i no mes per ping o port obert, sino buscant una cadena en l'HTML que retorni.
alguns exemples per configurar-ho:
group-XXX.cfg
define service {
use check-https-ant-service
host_name web_tester1
service_description web local
check_command check_https_antwort!127.0.0.1!443!/path!expected
}
XXX-services.cfg
define service{
name check-https-ant-service ; The 'name' of this service template
use srv-pnp
check_command check_https_antwort
service_description NRPE
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disa$
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program resta$
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 3 ; Re-check the service up to 3 times in order to det$
normal_check_interval 60 ; Check the service every 10 minutes under normal c$
retry_check_interval 1 ; Re-check the service every two minutes until a har$
contact_groups linux-admins ; Notifications get sent out to everyone in the 'adm$
notification_options w,u,c,r ; Send notifications about warning, unknown, critica$
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SER$
}
#test cada Hora
XXX-checkcommands.cfg
define command{
command_name check_https_antwort
command_line /usr/local/nagios/libexec/check_https_antwort $ARG1$:$ARG2$ $ARG3$ $ARG4$
}
i adjunt el perl per fer els checks.
Utilitza openssl per fer la coneixio, aixi que ja sabeu que heu d'instal.lar
Bibliografia:
Nagios plug-in development