Am 03.09.2014 23:47, schrieb Hans Scheffers:

Hans Scheffers
AIX / Linux Systeembeheer


Date: Wed, 3 Sep 2014 18:03:36 +0200
From: [email protected]<mailto:[email protected]>
To: [email protected]<mailto:[email protected]>
Subject: Re: [icinga-users] Icinga2 notifications & groups

Am 03.09.2014 16:32, schrieb Hans Scheffers:
> Hi,
>
> I am getting somewhere with the conversion of icinga to icinga2, just
> stumble upon 2 problems that i don't know how to solve:
>
> 1. We have a number of services that we don't want to send
> notifications. i tried 'enable_notifications = "false" ' in the
> service definition, but that results in an error.
>

Configs and detailed error message please. Further I'd like to see both,
1.x and 2.x configs and your explaination of migrating them.

The service definition i have:
object  Service "Disk Time S:" {
 import "generic-service"
 host_name     = "winserver"
 check_command = "check_nrpe_win"
 vars.command  = "CheckCounter"
 vars.arguments= "Counter=\\LogicalDisk(S:)\\% Disk Time"
 vars.maxcrit  = "90%"
 vars.maxwarn  = "80%"
 vars.max      = "0"
 vars.ShowAll  = "1"
 enable_notifications = "false"
}

and the error message:

$ service icinga2 checkconfig
...............
Config error: Invalid value for attribute: Object 'Disk Time S:' (Type: 'Service') 
at /etc/icinga2/zones.d/master/hosts/windows/winserver:32 -> Attribute 
'enable_notifications'
[2014-09-03 23:38:59 +0200] critical/config: 1 errors, 0 warnings

"false" is a string in your configuration snippet. You would want to use

enable_notifications = false

as boolean value as the error message implies with "Invalid value for 
attribute".





> 1. A number of services should only notify / be visible by our
> database administrators. I have a group defined for them, but how
> can i apply the service to the group?
>

Show us your attempt please. Further please explain what you mean by "be
visible". Notifications and users in Icinga 2 work for notifications.
The Classic UI contacts are a compatible workaround, but you would
rather use Icinga Web and define permissions based on host/service
groups or custom vars.

The databaseadministrators don't need / want to see al 50+ checks we run on a 
AIX LPAR, they just want to see the DB2 Checks.

_Where_?

In icinga 1.x :
define service{
       use                            generic-service
       host_name               aixserver
       service_description  DB2 Health
       contact_groups        dba
       check_command      check_nrpe!check_db2_health
       }

Icinga 2.1:
object Service "DB2 Maximum Connections" {
 import "generic-service"
 host_name     = "aixserver"
 check_command = "nrpe"
 vars.nrpe_command = "check_db2_max_connections"
 vars.sla      = "24x7"
 groups        = [ "databaseadmins" ]
}

in users.conf:
object UserGroup "databaseadmins"{
 display_name  = "Database en SAN administrators"
}


$ service icinga2 checkconfig
................
Config error: Invalid value for array index: Object 'DB2 Maximum Connections' (Type: 
'Service') at /etc/icinga2/zones.d/master/hosts/aix/aixserver.conf:36 -> Attribute 
'groups' -> Index 0: Object 'databaseadmins' of type 'ServiceGroup' does not exist.
[2014-09-03 23:41:10 +0200] critical/config: 1 errors, 0 warnings.


Please read the documentation throroughly for the attribute 'groups' and which 
value is required.

http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-service

Tip: There are no contact nor user groups on host or service objects in Icinga 
2.



-- 
Michael Friedrich, DI (FH)
Application Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | [email protected]

** Open Source Backup Conference 2014 - September - osbconf.org **
** Puppet Camp Duesseldorf 2014 - Oktober - netways.de/puppetcamp **
** OSMC 2014 - November - netways.de/osmc **
** OpenNebula Conf 2014 - Dezember - opennebulaconf.com **
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to