> On 31 Oct 2016, at 16:39, Antony Stone <antony.st...@icinga.open.source.it> > wrote: > > Hi. > > I've just defined a new CheckCommand for a plugin of my own: > > object CheckCommand "interface_bytecount" { > command = [ PluginDir + "/check_interface_bytecount" ] > } > > It takes no parameters, so according to the examples I see in section 9.3 of > http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/object-types > this should work.
Unfortunately the docs were highlighting some changes from the master branch. I’ve updated docs.icinga.org to only serve the latest support/2.5 branch until 2.6 is released. So you’re right about the required template import for the current released versions. Kind regards, Michael > > I get the error: > > critical/config: Error: Validation failed for object 'interface_bytecount' of > type 'CheckCommand'; Attribute 'execute': Attribute must not be empty. > > Reading section 9.3 more closely, it says: > > execute-Required. > The "execute" script method takes care of executing the check. The default > template "plugin-check-command" which is imported into all CheckCommand > objects takes care of this setting. > > This indicates to me that the "execute" method *is* required, but should be > supplied by a default import, so I don't need to specify it myself. > > If I change my CheckCommand definition to: > > object CheckCommand "interface_bytecount" { > import "plugin-check-command" > command = [ PluginDir + "/check_interface_bytecount" ] > } > > Then it works fine. > > Have I misunderstood the docs, or is there something odd going on, requiring > me to import plugin-check-command for myself? > > > Thanks, > > > Antony. > > -- > Normal people think "If it ain't broke, don't fix it". > Engineers think "If it ain't broke, it doesn't have enough features yet". > > Please reply to the list; > please *don't* CC me. > _______________________________________________ > icinga-users mailing list > icinga-users@lists.icinga.org > https://lists.icinga.org/mailman/listinfo/icinga-users -- Michael Friedrich, DI (FH) Senior Developer NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg Tel: +49 911 92885-0 | Fax: +49 911 92885-77 CEO: Julian Hein, Bernd Erk | AG Nuernberg HRB18461 http://www.netways.de | michael.friedr...@netways.de ** OSMC 2016 - November - netways.de/osmc ** ** OSDC 2017 - Mai – osdc.de ** _______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users