Major notification problem

lennart.kvam at softronic.se lennart.kvam at softronic.se
Wed Feb 8 00:57:22 CET 2006


Hi All!
 
I have major problem with getting notifications :-(
 
Here`s my configs:
 
Miscommands.cfg
 
define command{
        command_name    notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios  *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\nComment: $SERVICEACKCOMMENT$\n\n | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
        }
 
AND
 
# 'host-notify-by-email' command definition
  define command{
 command_name host-notify-by-email
 command_line /usr/bin/printf "%b" "***** Nagios  *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
 }
 
 
Minimal.cfg
 
define contact{
        contact_name                    nagios-admin
        alias                           Nagios Admin
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r,n
        host_notification_options       d,u,r,n
        service_notification_commands   notify-by-email
        host_notification_commands      host-notify-by-email
#        service_notification_commands   notify-by-sendEmail
#        host_notification_commands      host-notify-by-sendEmail
        email                           lelle at softronic.se <mailto:lelle at softronic.se> 
        }
 
 
define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 nagios-admin
        }
 
 
 
define host{
        name                            generic-host    ; The name of this host template
        notifications_enabled           1       ; Host notifications are enabled
        event_handler_enabled           1       ; Host 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 restarts
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
        }
 
 
define service{
        name                    generic-service ; The 'name' of this service template
        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 (disabling this can lead to major performance problems)
        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 restarts
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }
 
define host{
        use                     generic-host            ; Name of host template to use
        host_name               arnwin0136
        alias                   arnwin0136
        address                 192.168.103.100
        check_command           check-host-alive
        max_check_attempts      10
        notification_interval   120
        notification_period     24x7
        notification_options    d,u,r,
        notifications_enabled  1
        contact_groups      admins
        }
 
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       arnwin0136
        service_description             PING
        is_volatile                     0
        process_perf_data        1
        check_period                    24x7
        max_check_attempts              4
        normal_check_interval           5
        retry_check_interval            1
        notifications_enabled      1
        contact_groups                  admins
        notification_options       w,u,c,r
        notification_interval           960
        notification_period             24x7
 check_command   check_ping!100.0,20%!500.0,60%
        }
 
 


When i try in commandline with:  /bin/mail -s TEST lelle at softronic.se Its working like charm! but i need to press "ctrl"+ d to send it!
 
PLEASE HELP ME before i kill my self;-) Is there anymore files to edit? I have read tons of mail/forum but cant get it to work....
 
//Lennart
 
********************************** 
Lennart Kvam 
Softronic AB, Ringvägen 100, 118 60 Stockholm 
Tel: 0708-813279  Vx:08-51909000 
lennart.kvam at softronic.se 
**********************************
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060208/3a63f959/attachment.html>


More information about the Users mailing list