Permissions to view 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
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Permissions to view services

Post by nagiosjam »

Hi. I have a group of users who want to see alerts for a host , but do not want to see all alerts . I just want to see some alerts .

define contactgroup{
contactgroup_name grupocontacto1
alias grupocontacto1
members usuario1
}
define host{
use linux-server
host_name equipo1
alias equipo1
check_command check-host-alive
check_interval 5
retry_interval 1
max_check_attempts 5
contact_groups grupo1
hostgroups LINUX1
notification_interval 1440
notification_period workhours
notification_options d,u,r
}

I want to see only this alert

define service{
use generic-service
host_name equipo1
service_description CPU
check_command check_ssh_cpu!10!5
contact_groups grupocontacto1
}

And this other service not want to see

define service{
use generic-service,srv-pnp
host_name equipo1
service_description Ping
check_command check_ping
}


But I see two alerts .. please help , I feel speak so little English
I hope they understand me
Thank you
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Permissions to view services

Post by rkennedy »

Code: Select all

define service{
use generic-service,srv-pnp
host_name equipo1
service_description Ping
check_command check_ping
}
You should be able to add notifications_enabled 0 to disable notifications here. My guess is that one of your templates has them enabled. See this page for more information, and the options you can include in your definitions -
https://assets.nagios.com/downloads/nag ... tions.html
Former Nagios Employee
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: Permissions to view services

Post by nagiosjam »

Hello, thanks for the answer.
I have several contact groups and a contact group if you want to receive email notifications and have another contact group that does not receive all alerts .
For example group1 contact 10 alerts you want to receive mail services grupo2 contact host1 and only wants to receive 5 of these email alerts. Not if I explain well, my English is not very good . Thank you

Template generic-service

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
        normal_check_interval           10                      ; Check the service every 10 minutes under normal conditions
        retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
        contact_groups                  group1,group2           ; 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           120                    ; Re-notify about service problems every day (hour por defecto)
        notification_period             24x7                    ; Notifications can be sent out at any time
        register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }
Last edited by tmcdonald on Thu Apr 28, 2016 9:38 am, edited 1 time in total.
Reason: Please use [code][/code] tags around terminal output
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Permissions to view services

Post by rkennedy »

nagiosjam wrote:Hello, thanks for the answer.
I have several contact groups and a contact group if you want to receive email notifications and have another contact group that does not receive all alerts .
For example group1 contact 10 alerts you want to receive mail services grupo2 contact host1 and only wants to receive 5 of these email alerts. Not if I explain well, my English is not very good . Thank you

Template generic-service

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
        normal_check_interval           10                      ; Check the service every 10 minutes under normal conditions
        retry_check_interval            2                       ; Re-check the service every two minutes until a hard state can be determined
        contact_groups                  group1,group2           ; 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           120                    ; Re-notify about service problems every day (hour por defecto)
        notification_period             24x7                    ; Notifications can be sent out at any time
        register                        0                       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
        }
Could you please rephrase what you're looking to accomplish? Not sure I'm understanding correctly.
Former Nagios Employee
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Permissions to view services

Post by lmiltchev »

You can try setting up service escalations for the services that only one of the contactgroups wants to receive notifications about. Example:

Code: Select all

define serviceescalation {
	host_name                     		equipo1
	service_description           		Ping
	contact_groups                		grupocontacto1
	first_notification            		0
	last_notification             		5
	notification_interval         		60
	escalation_period             		24x7
	escalation_options            		w,u,c,
}
In this case, if the service "Ping" on host "equipo1" is in one of the following states (WARNING, UNKNOWN or CRITICAL), the notifications will be escalated to the "grupocontacto1" contactgroup. The other contactgroup ("grupocontacto2") shouldn't be receiving any notifications.

To learn more about service escalations, please review our documentation here:
https://assets.nagios.com/downloads/nag ... tions.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: Permissions to view services

Post by nagiosjam »

rkennedy
I have a host and this host has 10 services. and I have a group of contacts you want to receive email notification alerts only 5 and not 10 .
and I have another group that if I want to receive the 10 services

Thank you
nagiosjam
Posts: 81
Joined: Thu Feb 04, 2016 2:47 am

Re: Permissions to view services

Post by nagiosjam »

lmiltchev thank you
I'll try what you tell me scaling services
bwallace
Posts: 1146
Joined: Tue Nov 17, 2015 1:57 pm

Re: Permissions to view services

Post by bwallace »

Sounds good, let us know how it turns out and if we can assist with anything.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked