Sorry, this feels fairly basic, however, I’ve been reading through the docs and I’m clearly missing something.
I have a test environment up and running with a Sensu backend and two agents that have registered and are sending keepalive information, so the basics seem to be up and functioning.
The next thing I want to do is set up a Nagios check to monitor something. Based on the docs I’ve tried using the agent API to load a check but it throws the error “check has not been instantiated for this event”, does something else need to be loaded first?
Hello,
The agent’s event API is pretty advanced feature, and is not something I’d expect someone to try to use first. The agent’s event api makes it possible to let external scripts not run as Sensu checks to generate Sensu events (as if they were checks) It’s a bit advanced, Its probably not what you want. It’s definitely not what you want to use if you are trying to create and schedule Sensu checks.
What you probably want to do is install the sensuctl commandline tool and start creating checks on the Sensu backend, with the correct subscription and scheduling settings to run on the agents. Sensu uses a “subscription” model. Agents register which subscriptions they want to participate in, and checks have a corresponding subscriptions attribute indicating which subscriptions each check will be scheduled for.
yup… what Jef says, i’m still struggling quite a bit with the monitoring stuff but what i found is if you build your checks out of files (i prefer yaml) you can just senctl create -f filename then if you have to change it tweak the file a bit, sensuctl check delete checkname then just reimport the file to create the edited one