SAYMON allows to describe the infrastructure of any complexity in terms of objects and links between them. This infrastructure is then filled with information, received from monitoring agents, widgets with current metrics and graphs, painted in the colors of the states.
However, creating an infrastructure map manually is often too tiring, because it can contain thousands of objects. To solve this problem, SAYMON provides mechanisms for objects auto-detection. With their help, most of the objects of interest to the user can be added to the infrastructure map automatically, without time-consuming manual “clicking” in the web interface.
In SAYMON there are two types of object autodiscovery.
The first type is built-in mechanisms that work without any efforts from the user. These include, for example, the network autodiscovery mechanism, which displays in the diagram all the hosts available in the local network.
The second type is the methods in the REST API that can be used by client automation scripts to create objects in SAYMON. Using such scripts, any autodetection algorithm for any kind of infrastructure objects can be implemented.
The built-in autodiscovery mechanisms are implemented inside SAYMON and work automatically when the system is started (unless they are disabled by the system administrator).
SAYMON’s built-in autodiscovery mechanisms include network autodiscovery. Also the autodiscovery mechanisms of system services and the autodiscovery mechanism via SNMP are in the development.
The agent scans the local subnet and sends to the server information on all IP addresses available for a TCP connection or available via PING. Host objects with corresponding addresses are created in SAYMON and displayed on the infrastructure map. For them, monitoring is also automatically enabled using the Ping sensor.
Network autodiscovery can be enabled or disabled in the agent configuration file, using the parameter agent.discoveryEnabled (enabled by default). To disable network autodiscovery on the agent, this parameter must be set to false:
Autodiscovery via API
It is impossible to foresee all autodiscovery options for the whole variety of existing infrastructures. However, in SAYMON there is open REST API, using which the client can implement any suitable mechanism of objects autodiscovery using an automatic script. SAYMON's REST API works over HTTP, so the script can be implemented in any language or platform with an HTTP client.
The simplest example is a bash script with sending REST requests to SAYMON via
Adding objects via REST
For instance, there is a script that can detect a certain type of objects in the infrastructure (it can be network devices or software services). The detected objects can be added to SAYMON using the REST method POST/node/api/objects.
Example of a way it can be done in a bash script:
An important parameter with detecting an object is discovery_id. This is a string that unequivocally identifies an object in the infrastructure and avoids its re-creation in SAYMON.
If at the time of creating the object in SAYMON an object with the specified discovery_id already exists, the current object is simply modified with new data, and a new object will not be created. It allows to run an autodiscovery script multiple times (for example, on a schedule) and be sure that objects already detected will not be created again in SAYMON.
In case of network devices, discovery_id can be the device’s IP address or MAC address.