Posts by isuarezm

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

    I have managed to get notifications working through Director using the guide from unixe.de/icinga2-director-notifications/ (via google translate) but for some reason notifications are working only for Hosts and not Services, I'm working on figuring out why now.

    Tried that guide but the service-by-mail.sh script don't seem to be there anymore. And also, don't truly understand the "Notification" section therefore still can get hosts notifications to work either. :/ ---feeling 100% noobie

    Ups, sorry for that.


    Here goes the log error.



    Attached a screenshot for better viewing.

    OK. Assigned it to Hosts and now this:


    critical/config: Error: Validation failed for object '!UnixNotificationObject' of type 'Notification'; Attribute 'host_name': Attribute must not be empty.Location: in /var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693918-1/zones.d/icinga.coqui.com/notifications.conf: 1:0-1:43/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693918-1/zones.d/icinga.coqui.com/notifications.conf(1): object Notification "UnixNotificationObject" { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693918-1/zones.d/icinga.coqui.com/notifications.conf(2): import "UnixNotificationTemplate"/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693918-1/zones.d/icinga.coqui.com/notifications.conf(3): critical/config: 1 error

    ^^^


    I had this issue also, go to Director -> Zones, Add zone, name: director-global, global = yes and save/deploy, then I think I went into CLI and ran "icingacli director zone create director-global --is_global --object_type external_object" and after that restart icinga2.


    The issue is described in https://dev.icinga.org/issues/11525 which comes up if you google for the error you are receiving: Object 'director-global' of type 'Zone' does not exist

    Thanks for that one!


    Now while creating the Apply Rule I get the following:


    critical/config: Error: 'apply' target type is ambiguous (can be one of 'Host' or 'Service'): use 'to' to specify a typeLocation: in /var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693072-0/zones.d/director-global/notification_apply.conf: 1:0-1:17/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693072-0/zones.d/director-global/notification_apply.conf(1): apply Notification "UnixNotification" { ^^^^^^^^^^^^^^^^^^/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693072-0/zones.d/director-global/notification_apply.conf(2): import "UnixNotificationTemplate"/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466693072-0/zones.d/director-global/notification_apply.conf(3):

    This should probably have been the answer to your question. Please let us know whether it helped, so that we can close this thread. Latest comments are all but related to your initial problem, discussion starts getting confusing.


    Could you please let us know whether you have been able to solve yourissue?

    This should probably have been the answer to your question. Please let us know whether it helped, so that we can close this thread. Latest comments are all but related to your initial problem, discussion starts getting confusing.
    Cheers,
    Thomas


    NB: And please pull the latest master, many other notification-related little issues have been fixed in the meantime.

    I can create the "Command" Template with no issues but the Object gives error on Deploy.


    critical/config: Error: Validation failed for object 'CoquiNotificationCom' of type 'NotificationCommand'; Attribute 'zone': Object 'director-global' of type 'Zone' does not exist.Location: in /var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf: 3:1-3:49/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf(1): library "methods"/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf(2): /var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf(3): object NotificationCommand "CoquiNotificationCom" { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf(4): import "CoquiNotificationTemp"/var/lib/icinga2/api/packages/director/icinga.coqui.com-1466535483-0/zones.d/director-global/commands.conf(5):

    Got this now:


    Storing icinga_notification[CoquiNotification] failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'apply_to' in 'field list', query was: INSERT INTO icinga_notification (object_name, object_type, disabled, apply_to, host_id, service_id, times_begin, times_end, command_id, notification_interval, period_id, zone_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) {array ( 'id' => NULL, 'object_name' => 'CoquiNotification', 'object_type' => 'template', 'disabled' => 'n', 'apply_to' => NULL, 'host_id' => NULL, 'service_id' => NULL, 'times_begin' => NULL, 'times_end' => NULL, 'command_id' => NULL, 'notification_interval' => NULL, 'period_id' => '9', 'zone_id' => NULL,)}

    /var/log/messages errors found


    Jun 2 16:53:35 icinga icingaweb2[14737]: Icinga\Exception\NotFoundError in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:583 with message: Failed to load icinga_timeperiod "7"
    Jun 2 16:53:35 icinga icingaweb2[14737]: Stacktrace: #0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1010): Icinga\Module\Director\Data\Db\DbObject->loadFromDb() #1 /usr/s

    CentOS 6.7
    Icinga2, Icinga Web 2, Icinga Director
    MySQL


    Notifications not being sent on new hosts. Only receiving the default notifications. (Example Backup Downtime notifications)


    When trying to create a new Notification through Director, when I select the "Time period" and hit "Store" y gives the following error on screen:


    Failed to load icinga_timeperiod "7"



    #0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1010): Icinga\Module\Director\Data\Db\DbObject->loadFromDb()
    #1 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(270): Icinga\Module\Director\Data\Db\DbObject::load('7', Object(Icinga\Module\Director\Db))
    #2 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(335): Icinga\Module\Director\Objects\IcingaObject->resolveUnresolvedRelatedProperty('period_id')
    #3 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(404): Icinga\Module\Director\Objects\IcingaObject->get('period_id')
    #4 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(788): Icinga\Module\Director\Data\Db\DbObject->getProperties()
    #5 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(615): Icinga\Module\Director\Objects\IcingaObject->resolve('Properties')
    #6 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(693): Icinga\Module\Director\Objects\IcingaObject->resolveProperties()
    #7 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(605): Icinga\Module\Director\Objects\IcingaObject->getInherited('Properties')
    #8 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(248): Icinga\Module\Director\Objects\IcingaObject->getInheritedProperties()
    #9 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(798): Icinga\Module\Director\Web\Form\DirectorObjectForm->handleProperties(Object(Icinga\Module\Director\Objects\IcingaNotification), Array)
    #10 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(404): Icinga\Module\Director\Web\Form\DirectorObjectForm->onRequest()
    #11 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(411): Icinga\Module\Director\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
    #12 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(419): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
    #13 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(303): Icinga\Module\Director\Web\Form\QuickForm->hasBeenSent()
    #14 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(190): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
    #15 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Director\Web\Controller\ObjectController->addAction()
    #16 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('addAction')
    #17 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    #18 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    #19 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
    #20 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
    #21 {main}



    Does anyone have an idea to give me some direction here?


    Help would be highly appretiated!!!! thanks!

    Getting the following error after configuring through Icinga Director a NRPE check:
    CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages


    If i run the command manually I runs ok:
    [root@icinga conf.d]# /usr/lib64/nagios/plugins/check_nrpe -c check_var_disk -H 172.20.220.194
    DISK OK - free space: /var 29772 MB (78% inode=99%);| /var=8179MB;30668;34501;0;38335


    What can I check to try and resolv?

    When I go to Icinga Director, Commands, and select the nrpe command and then select the Fields tab. I get the following error:


    Apr 13 14:07:09 icinga icingaweb2[4149]: ErrorException in /usr/share/icingaweb2/modules/director/application/forms/IcingaObjectFieldForm.php:64 with message: Undefined offset: 2
    Apr 13 14:07:09 icinga icingaweb2[4149]: Stacktrace:
    #0 /usr/share/icingaweb2/modules/director/application/forms/IcingaObjectFieldForm.php(64): Icinga\Application\{closure}(8, 'Undefined offse...', '/usr/share/icin...', 64, Array)
    #1 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(288): Icinga\Module\Director\Forms\IcingaObjectFieldForm->setup()
    #2 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(403): Icinga\Module\Director\Web\Form\QuickForm->prepareElements()
    #3 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(411): Icinga\Module\Director\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
    #4 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(419): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
    #5 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(303): Icinga\Module\Director\Web\Form\QuickForm->hasBeenSent()
    #6 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(257): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
    #7 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Director\Web\Controller\ObjectController->fieldsAction()
    #8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('fieldsAction')
    #9 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    #10 /usr/share/php/Icinga/Application/Web.php(383): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    #11 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
    #12 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
    #13 {main}


    This is a new Icinga2 installation with Icinga Web 2 and Icinga Director installed on CentOS 6.7.


    Thanks for any help!!


    NOTE: Trying to implement Icinga to replace Nagios.