Posts by frayber

This forum was archived to /woltlab and is now in read-only mode.

    dnsmichi I know, I just upgraded from 2.7 to 2.8 whit yum and read documentatin, I made db schema upgrade too, but when I restarted Icinga, it didn't started anymore, so I had to search log for a solution:

    1) after upgrading, the folder /etc/icinga2/repository.d didn't exists anymore, here the log:

    Nov 20 12:37:51 vm-lxmonitor icinga2: [2017-11-20 12:37:51 +0100] critical/config: Error: Error while evaluating expression: Function call 'opendir' for file '/etc/icinga2/repository.d' failed with error code 2, 'No such file or directory'

    Removing 'include_recursive “repository.d”' in etc/icinga2.conf solved this issue.

    2) the cert files problem, I had to manually copy cert files to the new location

    Hi, I’ve just upgraded from 2.7 version to 2.8 (red hat repository with yum, centos OS)

    I had two issues:

    1) repository.d folder has been removed, but in /etc/icinga2/icinga.conf is still present this row:

    include_recursive “repository.d”

    You have to remove it or you’ll get error in icinga startup

    2) as reported by other users, certificates path changed, I had to manually move certificates from /etc/icinga2/pki to /var/lib/icinga2/certs, no automatic move as written in upgrade instructions

    Hi, I'm trying to combine boolean operators in order to get nested expressions (like (host.name == "host1" && host.name == "host2")||host.name == "host3")) but I can't do this, all the operators are transformed in the first one.

    Example: I want (host.name == "host1" && host.name == "host2")||host.name == "host3")


    I set like applyrule.png (see attachment)


    store


    I get like applyrule.png (see attachment): the OR operator becomed AND

    In the preview I get host.name == "host1" && host.name == "host2" && (host.name == "host3")


    Is this a bug or am I doing something wrong?

    Thank you

    Hello, I'm trying to set Active Directory authentication and group authentication.

    I can view users and groups in web interface, I can login, but I can't associate active directory group with an administrative icinga group. Here is my configuration:


    groups.ini

    [Gruppi Active Directory]

    resource = "Active Directory"

    user_backend = "aduser"

    backend = "msldap"

    base_dn = "OU=xx,DC=xx,DC=xx,DC=xx"

    group_class = "group"

    group_name_attribute = "sAMAccountName"

    group_member_attribute = "member"

    group_filter = "!(objectClass=computer)"


    resources.ini

    [Active Directory]

    type = "ldap"

    hostname = "xxx"

    port = "389"

    encryption = "none"

    root_dn = "OU=xx,DC=xx,DC=xx,DC=xx"

    bind_dn = "xx"

    bind_pw = "xx"


    roles.ini

    [Administrators]

    users = "admin"

    permissions = "*"

    groups = "Administrators"


    [Sistemisti]

    permissions = "*"

    groups = "mygroup"


    where "mygroup" is the Active Directory group to be authorized.


    I think the issue is in the active directory groups' members, because in the icingaweb user groups page, clicking on the group members, I see users in this way:


    CN=xx,OU=xx,OU=xx,DC=xx,DC=xx,DC=xx


    but I think it should be only CN=xx, if I click on the user link I get not found.

    Anyone knows how to fix this problem?

    Hi, I configured email notifications, now I'm trying to make sms notification.

    I created sms-service-notification.sh by modifying original email-service-notification.sh, I tested this script and works.

    I have some problem with director configuration, it does not work, this is what I did:

    1) created a new notification template:

    Code
    1. template Notification "notifica-sms-servizi" {
    2. import "generic-notification"
    3. command = "sms-service-notification"
    4. users = [ "Francesco" ]
    5. }

    2) created a new apply rule for this:

    Code
    1. apply Notification "Notifiche sms servizi" to Service {
    2. command = "sms-service-notification"
    3. period = "24x7"
    4. assign where host.name == "vm-francia3"
    5. users = [ "Francesco" ]
    6. }

    3) created a new command:

    Which could be the problem?

    Thank you.

    I followed mcktr' suggestion and now I deployed without errors, but now the check returns "NRPE v2.15", so it seems that the disk data fields aren't passed to apply service rules.

    I added the line vars.disk_partition = config by creating a new string data field, added it to service definition and in the service apply rule I set the value to "$config$".

    But the error remains.

    my host definition:


    object Host "cloudlinux1" {

    import "Standard Server Linux"


    address = "192.168.111.8"

    check_command = "hostalive"

    groups = [ "Servers-Linux" ]

    vars.disks = [ "check_root" ]

    }


    my service apply rule:


    apply Service "check-disk-linux" for (config in host.vars.disks) {

    import "check-disk-linux"


    assign where "Servers-Linux" in host.groups


    import DirectorOverrideTemplate

    }


    the only difference from your post is this line in service apply rule:


    vars.disk_partition = config



    Hi Kevin, thet's exactly what I want to do. I understand it in icinga configuration files, but in director I can't do it.

    In the service apply rule, there is a menu "Apply For" with this description:


    Evaluates the apply for rule for all objects with the custom attribute specified. E.g selecting "host.vars.custom_attr" will generate "for (config in host.vars.array_var)" where "config" will be accessible through "$config$". NOTE: only custom variables of type "Array" are eligible.


    It was empty, so I added the field to the host template, and now I can select it.

    This is the service apply rule config:


    apply Service "check-disk-linux" for (config in host.vars.disks) {

    import "check-disk-linux"


    assign where "Servers-Linux" in host.groups


    import DirectorOverrideTemplate

    }


    But now when I deploy I get this error:


    critical/config: Error: Dictionary iterator requires value to be a dictionary.

    Location: in /etc/icinga2/conf.d/services.conf: 65:1-65:53

    /etc/icinga2/conf.d/services.conf(63): }

    /etc/icinga2/conf.d/services.conf(64):

    /etc/icinga2/conf.d/services.conf(65): apply Service for (disk => config in host.vars.disks) {

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    /etc/icinga2/conf.d/services.conf(66): import "generic-service"

    /etc/icinga2/conf.d/services.conf(67):


    (0) Evaluating 'apply' rule (in /etc/icinga2/conf.d/services.conf: 65:1-65:53)

    (1) Evaluating 'apply' rules for host 'cloudlinux1'

    This is what I did:

    1) I defined a data field "disks" of type array

    2) in linux server host template I attacched this field

    3) in host definition, in custom properties, I put the name of the disk(s)


    object Host "cloudlinux1" {

    import "Standard Server Linux"


    address = "192.168.111.8"

    check_command = "hostalive"

    groups = [ "Servers-Linux" ]

    vars.disks = [ "check_root" ]

    }


    And now? What should I do in service apply rule? I'd like that service loads the vars.disk from host and put them in the nrpe command, which I defined in the service template:


    template Service "check-disk-linux" {

    import "generic-service2"


    check_command = "check_nrpe"

    vars.nrpe_command = "xxxxxx"

    }

    Hello, I'm trying to define in the best way the disks' check, both linux and windows.

    I'd like to define (somewhere in host definition) disk names in an array, and in the service definition take the array parameters and give them to the check command.

    I don't know how to do this, or maybe ther is a better way to do this.

    Do you have any idea?

    Thank you, bye

    What about the service tab in the host configuration? I see "Applied services" and here are the generic services inherithed from the apply rules, but what are "Individual Service objects"? I can define them, but I can set only name and imports, how does it works?

    Oh, now I see it, I had only one generic service and "create apply rule" appears only starting from the second template!

    Very good, let's start playing :-)

    Thank you very much

    Hello everybody, I'm new here, I'm working on migrating my old nagios 3 to icinga2+director. At the moment I imported hosts with sql source from nagiosql database.

    Now I'm trying to make some test in order to see how director works.

    There is a thing I can't understand: how can I define a service and link it to a host? If I click on "services" I can only create templates, if I entere an host I can add one ore more services, but I can't use parameters.

    I think it's quite different from Nagios, but I don't understand this.

    Thank you all, bye.