I can't deploy anything anymore - Error: Validation failed for object

Hello together,

Since I deleted a user in Icinga, I can’t deploy anything anymore, this error always occurs:

critical / config: Error: Validation failed for object UNKNOWN ‘of type’ Notification ': Validation failed: No users / user_groups specified.

Neither on the Ubuntu server in the config files nor in the Icinga Directer can I find anything how to solve the problem.

It would be wonderful if someone could help me. I am also very happy to send configuration data items and screens. Please tell me what to post.

Thanks in advance.

Hello @tom2, can you post the contents of users.conf and notifaction.conf files here Please?

Hello Yonas,

thanks for your replay

cat /etc/icinga2/conf.d/users.conf
/**************************

  • Userdefinitionen
    **************************/

object User “icingaadmin” {
import “generic-user”

display_name = “Icinga 2 Admin”
groups = [ “icingaadmins” ]

//email = “root@localhost”
}

/*
object User “xxxxx” {
import “generic-user”

display_name = “yyyyyyyyyyy”
groups = [ “icingaadmins” ]

email = “yyyyyy@yyyyy.yy”
}
*/

object UserGroup “icingaadmins” {
display_name = “Icinga 2 Admin Group”
}

and

cat /etc/icinga2/features-available/notification.conf
/**

  • The notification component is responsible for sending notifications.
    */

object NotificationComponent “notification” { }
root@xxxxxx:~# cat /etc/icinga2/features-enabled/notification.conf
/**

  • The notification component is responsible for sending notifications.
    */

object NotificationComponent “notification” { }

Interesting is that the object User and the display name are different users. The user which is written in object user I have deleted.

object User “xxxxx” {
import “generic-user”

display_name = “yyyyyyyyyyy”

You have probably defined a notification command somewhere with the deleted user as contact information.

can you also check the content of /et/icinga2/config.d/notification.conf file?

And if you have not edited this file at all try to run config Validation manually on the server Icinga2 daemon -C. This might help you to find out where the Config Validation error occurs.

Best,
Yonas

/etc/icinga2/conf.d# cat notifications.conf
/**

  • The example notification apply rules.
  • Only applied if host/service objects have
  • the custom attribute notification defined
  • and containing mail as key.
  • Check hosts.conf for an example.
    */

apply Notification “mail-icingaadmin” to Host {
import “mail-host-notification”

interval = 0s
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users

assign where host.vars.notification.mail
}

apply Notification “mail-icingaadmin” to Service {
import “mail-service-notification”

interval = 0s
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users

assign where host.vars.notification.mail
}

icinga2 daemon -C
[2020-10-23 19:06:17 +0200] information/cli: Icinga application loader (version: r2.12.0- 1)
[2020-10-23 19:06:17 +0200] information/cli: Loading configuration file(s).
[2020-10-23 19:06:17 +0200] information/ConfigItem: Committing config item(s).
[2020-10-23 19:06:17 +0200] information/ApiListener: My API identity: TL01-Nagios01
[2020-10-23 19:06:18 +0200] warning/ApplyRule: Apply rule ‘satellite-host’ (in /etc/icing a2/conf.d/satellite.conf: 29:1-29:41) for type ‘Dependency’ does not match anywhere!
[2020-10-23 19:06:18 +0200] warning/ApplyRule: Apply rule ‘App MobileX ENTW’ (in /var/lib /icinga2/api/packages/director/77000221-843d-45dd-a8c6-2cbedc5a9b0b/zones.d/TL01-Nagios01 /notification_apply.conf: 190:1-190:48) for type ‘Notification’ does not match anywhere!
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 222 Hosts.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 6 NotificationCommands.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 3761 Notifications.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 51 HostGroups.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 641 Dependencies.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 137 Zones.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 StatusDataWriter.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 136 Endpoints.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 ExternalCommandListene r.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 8 ApiUsers.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 CompatLogger.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 258 CheckCommands.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 InfluxdbWriter.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1 LivestatusListener.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 8 TimePeriods.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 9 UserGroups.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 18 Users.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 1045 Services.
[2020-10-23 19:06:18 +0200] information/ConfigItem: Instantiated 7 ServiceGroups.
[2020-10-23 19:06:18 +0200] information/ScriptGlobal: Dumping variables to file ‘/var/cac he/icinga2/icinga2.vars’
[2020-10-23 19:06:18 +0200] information/cli: Finished validating the configuration file(s ).

config validation
-bash: config: command not found

You have probably defined a notification command somewhere with the deleted user as contact information.

Yes this is exactly the problem.
I can not find in Icinga director this defined notification.
And just from this tiny problem the whole Icinga does not allow any change anymore.

I do not know how to solve this problem in Icinga diretor and also not in this config files above.

Could you please help me further?

config validation
-bash: config: command not found

No :grinning:, the config Validation command does not really exist but what you did with Icinga2 daemon -C is usually called config validation.

cat /etc/icinga2/conf.d/satellite.conf
/*

  • Host and Service templates for the Agent Setup.
    */

/**

  • Provides settings for satellite hosts managed by ‘icinga2 repository’.
  • Define your global attributes here, for example custom
  • attributes used for notifications, etc.
    */
    template Host “satellite-host” {
    vars.notification[“mail”] = {
    groups = [ “icingaadmins” ]
    }
    }

/**

  • Provides settings for satellite services managed by ‘icinga2 repository’.
  • Define your global satellite attributes here, for example custom
  • attributes used for notifications, etc.
    */
    template Service “satellite-service” {
    vars.notification[“mail”] = {
    groups = [ “icingaadmins” ]
    }
    }

apply Dependency “satellite-host” to Host {
parent_host_name = host.zone

assign where host.zone != “” && “satellite-host” in host.templates
}

/var/lib /icinga2/api/packages/director/77000221-843d-45dd-a8c6-2cbedc5a9b0b/zones.d/TL01-Nagios01 /notification_apply.conf

Here you can see that for some reason the notification command in this file does not match anywhere.

can you post the content of the following file please?
/var/lib/icinga2/api/packages/director/77000221-843d-45dd-a8c6-2cbedc5a9b0b/zones.d/TL01-Nagios01/notification_apply.conf

Best,
Yonas

/*

  • Host and Service templates for the Agent Setup.
    */

/**

  • Provides settings for satellite hosts managed by ‘icinga2 repository’.
  • Define your global attributes here, for example custom
  • attributes used for notifications, etc.
    */
    template Host “satellite-host” {
    vars.notification[“mail”] = {
    groups = [ “icingaadmins” ]
    }
    }

/**

  • Provides settings for satellite services managed by ‘icinga2 repository’.
  • Define your global satellite attributes here, for example custom
  • attributes used for notifications, etc.
    */
    template Service “satellite-service” {
    vars.notification[“mail”] = {
    groups = [ “icingaadmins” ]
    }
    }

apply Dependency “satellite-host” to Host {
parent_host_name = host.zone

assign where host.zone != “” && “satellite-host” in host.templates
}

cat /var/lib/icinga2/api/packages/director/77000221-843d-45dd-a8c6-2cbedc5a9b0b/zones.d/TL01-Nagios01/notification_apply.conf
apply Notification “Windows Server xx Host Notification” to Host {
import “notification_template_host”

interval = 0s
period = "24x7_always"
assign where match("*", host.name)
states = [ Down, Up ]
types = [ Acknowledgement, Custom, Problem, Recovery ]
users = [ "XXX", "THIS IS THE DELETET USER" ]

}

apply Notification “Windows Server xx Service Notification” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
assign where match("*", service.name)
states = [ Critical, OK, Warning ]
types = [ Acknowledgement, Custom, Problem, Recovery ]
users = [ "THIS IS THE DELETET USER" ]

}

/* — This object has been disabled —
apply Notification “Server Backnang Service Notification” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
assign where match("*", service.name)
states = [ Critical, OK, Unknown, Warning ]
types = [ Custom, Problem, Recovery ]
users = [ "THIS IS THE DELETET USER" ]

}

/
/
— This object has been disabled —
apply Notification “Server Backnang Host Notification” to Host {
import “notification_template_host”

interval = 0s
period = "24x7_always"
assign where match("*", host.name)
states = [ Down, Up ]
types = [ Acknowledgement, Custom, Problem, Recovery ]
users = [ "THIS IS THE DELETET USER" ]

}

*/
apply Notification “TCDA eigene Prozesse” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
assign where service.name == "check_mysql_query_hpesm_incidents"
states = [ Critical, OK, Warning ]
types = [
    Acknowledgement,
    Custom,
    DowntimeStart,
    Problem,
    Recovery
]
users = [ "XXX" ]

}

apply Notification “Windows Server Service Notification UNKNOWN” to Service {
import “notification_template_service”

times = {
    begin = 1h
}
interval = 0s
period = "10x5_businesstime"
assign where match("*", service.name)
states = [ OK, Unknown ]
types = [ Acknowledgement, Custom, Problem, Recovery ]
users = [ "THIS IS THE DELETET USER" ]

}

apply Notification “TCDA XXX Benachrichtigungen” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
assign where match("XXX*", service.name)
states = [ Critical, OK, Warning ]
types = [ Custom, DowntimeEnd, DowntimeStart, Problem, Recovery ]
users = [ "XXX", "XXX", "XXX" ]

}

apply Notification “T.XXX Benachrichtigungen-Dienste” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
x
states = [ Critical, OK, Warning ]
types = [ Custom, DowntimeEnd, DowntimeStart, Problem, Recovery ]
users = [ "XXX", "XXX" ]

}

apply Notification “T.XXX Benachrichtigungen-HOSTS” to Host {
import “notification_template_service”

interval = 0s
period = "24x7_always"
xxxxxx
states = [ Down, Up ]
users = [ "XXX", "XXX" ]

}

/* — This object has been disabled —
apply Notification “R.XXX Benachrichtigungen-Dienste” to Service {
import “notification_template_service”

interval = 0s
period = "10x5_businesstime"
xxxx
states = [ Critical, OK, Warning ]
types = [ Custom, DowntimeEnd, DowntimeStart, Problem, Recovery ]
users = [ "XXX" ]

}

*/
apply Notification “R.XXX Benachrichtigungen-HOSTS” to Host {
import “notification_template_service”

interval = 0s
period = "10x5_businesstime"
xxxx
states = [ Down, Up ]
users = [ "XXX" ]

}

apply Notification “akcp Sicherheitsgruppe Host” to Host {
import “notification_template_host”

period = "24x7_always"
assign where match("akcp*", host.name)
states = [ Down, Up ]
types = [ DowntimeEnd, DowntimeStart ]
user_groups = [ "akcp" ]

}

apply Notification “akcp Sicherheitsgruppe Service” to Service {
import “notification_template_host”

period = "24x7_always"
assign where match("akcp*", host.name)
states = [ Critical, OK, Unknown, Warning ]
types = [
    Acknowledgement,
    Custom,
    DowntimeEnd,
    DowntimeRemoved,
    DowntimeStart,
    Problem,
    Recovery
]
user_groups = [ "akcp" ]

}

apply Notification “R.XXX Benachrichtigungen-Dienste” to Service {
import “notification_template_service”

interval = 0s
period = "24x7_always"
xxx
states = [ Critical, OK, Warning ]
types = [ Custom, DowntimeEnd, DowntimeStart, Problem, Recovery ]
users = [ "XXX", "XXX" ]

}

apply Notification “XXX” to Service {
import “notification_template_service”

period = "24x7_always"
assign where "XXX" in host.groups
user_groups = [ "XXX" ]

}

apply Notification “XXX” to Service {
import “notification_template_service”

period = "24x7_always"
assign where "XXX" in host.groups
user_groups = [ "XXX" ]

}

apply Notification “XXX” to Service {
import “notification_template_service”

period = "24x7_always"
assign where "XXX" in host.groups
user_groups = [ "XXX" ]

}

:grinning: :grinning:
yes you are right

Shell I delete all parts in the

/var/lib/icinga2/api/packages/director/77000221-843d-45dd-a8c6-2cbedc5a9b0b/zones.d/TL01-Nagios01/notification_apply.conf

which consists the “deletet user”?

If the notifications are not important to you you can simply delete them all or replace the deleted user by an existing user e.g. Icinga2 default user icingaadmin then you should be able to validate the config.

Best,
Yonas

Or shell I replace it with my admin user?

Yes, of course, if you have defined the user somewhere :thinking: then you can simply replace them with it.