I’m developing a special_agent plugin for cisco devices that uses restconf to poll data from devices. For this I’m using the new plugin API.
So far everything is working properly, however I’ve encountered some shortcomings. Some api endpoints return huge amount of data at once to be run every check on the host. I’ve figured this is what the discovery process is for.
How can I use the discovery process to execute a full data poll and then execute more specific polls once the items to monitor are discovered in a special_agent?
Is there a flag or function available which I could for example call from the server_side_call script and pass along as argument to the agent executable?
What is the intended way to do this? Currently the agent is run the same during discovery and regular checks.
to my knowledge this is neither possible nor wanted.
The influence-chain is:
Special Agent Ruleset → Server Side Call → Special Agent → Agent Based Plugin
So you either have to directly filter the output in your Special Agent and then refine your API calls, or refine your call already in the Special Agent Ruleset.
There is no difference for the special agent if it is called for a discovery or for a check.
But I asked myself the same thing a few years ago, if it is somehow possible for the special agent to determine if it’s running in “discovery” or “normal check” mode.
I wanted to do a complex port scan and url discovery in the special agent on discovery and then store the discovered port/url somewhere so that it can be used for the “normal check mode”.
I never finished this but I got the hint that the argument-thingy could be the place to place such discovery code. Just an inspiration, not sure if this is anything worth.