On 09/10/2018 10:30 AM, Václav Mach wrote: > Hi, > > I'm using a script for automatic deployments of new configuration using > director. The script should notify me when some problem occurs. The script is > called from cronjob. > > A part of this script checks if the configuration was deployed successfully > or not - see > https://github.com/CESNET/eduroam-icinga/blob/master/sync/main.sh#L31-L47 > > It seems that this specific parts behaves strange. Sometimes it gives me the > startup log as it should, but sometimes it just gives me NULL. The deploy > takes only several seconds, at least it seems so from icingaweb - > configuration is successfully deployed several seconds after cronjob ran. > > Is there some better way to check if the newly deployed configuration is > valid and that startup log does not contain any warnings/errors?
It would obviously be an up-front cost, but using the REST API may be useful particularly looking forward. You can do a lot with it, including /director/config/deploy. However, I'm not sure if you can (yet) read the activities or deployments information. I receive a 404 from /director/config/activities and /director/config/deployments, but /director/config/deploy returns the checksum that could theoretically be used in further requests/queries. That same checksum is stored in the database, so a hybrid approach in the interim may be possible e.g.: mysql# select startup_succeeded, startup_log from director_deployment_log where hex(config_checksum) = '<checksum returned by API call>' > > cheers, > Vaclav > > > _______________________________________________ > icinga-users mailing list > icinga-users@lists.icinga.org > https://lists.icinga.org/mailman/listinfo/icinga-users > _______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users