Hi Cullen,
Sorry for the delay in getting back to you - not got much time to spare recently.
First you need to fix a bug I found trying to make an example! nagctl needs updating, so on the nagios/nagrestconf host:
cd /usr/bin/
mv nagctl nagctl.old
chmod 0755 nagctl
Now for the example. I just installed nagrestconf and nagios using the nagrestconf docker installation instructions on my PC, then:
Using nrcq, you can view a serviceset called local-checks, with the service description, Num Users
$ nrcq
http://localhost:8880/rest show/servicesets -f 'name:local-checks,svcdesc:Num Users'
name:local-checks
template:svctmpl-lin
command:check_users!-w 15 -c 20
svcdesc:Num Users
activechecks:1
Then add the event handler and view again:
$ nrcq
http://localhost:8880/rest modify/servicesets -d "name:local-checks" -d "svcdesc:Num Users" -d "eventhandler:myeventhandler"
SUCCESS
$ nrcq
http://localhost:8880/rest show/servicesets -f 'name:local-checks,svcdesc:Num Users'
name:local-checks
template:svctmpl-lin
command:check_users!-w 15 -c 20
svcdesc:Num Users
activechecks:1
disable:0
eventhandler:myeventhandler
Go back to the GUI and press Apply.
When you 'Re-apply service sets' to a host, or create a new host, and the event handler does not exist then the apply will fail with a descriptive 'nagios -v' error.
To delete the event handler use a '-', for example:
$ nrcq
http://localhost:8880/rest show/servicesets -f 'name:local-checks,svcdesc:Num Users'
name:local-checks
template:svctmpl-lin
command:check_users!-w 15 -c 25
svcdesc:Num Users
activechecks:1
disable:0
Hope this helps!
Mark