Send mail for some services

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Snakepit-97
Posts: 1
Joined: Wed Dec 02, 2020 9:22 am

Send mail for some services

Post by Snakepit-97 »

Hello guys

I'm noob in nagios and i'm trying set up send mail for only some services, for example disk and ram memory, and i'm use the template.cfg and windows.cfg

in windows.cfg i use the template generic-service for define my services, and i comment this in template .cfg

Code: Select all


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
    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
    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 determine its final (hard) state
    check_interval                  1                       ; Check the service every 10 minutes under normal conditions
    retry_interval                  2                       ; Re-check the service every two minutes until a hard state can be determined
#   contact_groups                  admins                  ; Notifications get sent out to everyone in the 'admins' group
#   notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
#   notification_interval           60                      ; Re-notify about service problems every hour
#   notification_period             24x7                    ; Notifications can be sent out at any time
but I keep getting notifications by mails for services that I don't configure in windows.cfg

this is how my windows.cfg looks

Code: Select all

#FOR DISK E:\
define service {
    use                     generic-service,srv-pnp
    host_name               Uritorco,PissisII,Salin
    service_description     E:\ Drive Space
    check_command           check_nt!USEDDISKSPACE!-l e -w 90 -c 95
    notification_interval   420
    notification_period     reporte_de_discos
    notification_options    w,c
    contact_groups          admins
}
In theory it should take that configuration but it is sending me emails from other services that are not defined in windows.cfg
Locked