Gather and normalize ICT inventory data from multiple sources, to enable automation of ICT carbon and environmental impacts (LCA-inspired) assessments.
I want to use cabestan to gather my assets list from my centreon instance.
Solution
centreon centralize host (device for cabestan) and services (usage data for cabestan).
A host is any device that has an IP address and that one wishes to monitor. For example, a physical server, a virtual machine, a temperature probe, an IP camera, a printer or a storage space.
A service is a check point, or indicator, to be monitored on a host. This can be the CPU usage rate, temperature, motion detection, bandwidth usage rate, disk I/O, and so on.
We could export or list devices and services with cabestan.
A graphical interface to export centreon configuration as a txt file.
This will generate CLAPI commands (for a later importation) and redirect them to the /tmp/clapi-export.txt file. The explotation of the file might not be straitforward.
This will generate CLAPI commands (for a later importation) and redirect them to the /tmp/clapi-export.txt file. The explotation of the file might not be straitforward.
Problem
I want to use cabestan to gather my assets list from my centreon instance.
Solution
centreon centralize host (device for cabestan) and services (usage data for cabestan).
We could export or list devices and services with cabestan.
Export centreon configuration
via Web platform (manual)
doc : https://docs.centreon.com/docs/21.04/monitoring/web-import-export/
A graphical interface to export centreon configuration as a txt file. This will generate CLAPI commands (for a later importation) and redirect them to the /tmp/clapi-export.txt file. The explotation of the file might not be straitforward.
via CLAPI (command line)
doc : https://docs.centreon.com/docs/api/clapi/#export
centreon -u admin -p 'centreon' -e > /tmp/clapi-export.txt
This will generate CLAPI commands (for a later importation) and redirect them to the /tmp/clapi-export.txt file. The explotation of the file might not be straitforward.
List assets
via API v2
OpenAPI spec : https://raw.githubusercontent.com/centreon/centreon/21.10.x/doc/API/centreon-api-v21.10.yaml
To list all resources (Host + service) :
result
```json { "result": [ { "type": "service|host", "short_type": "s|h", "id": 12, "name": "Ping", "alias": null, "fqdn": null, "links": { "uris": { "value": "Host
To list all host :
{{baseUrl}}/monitoring/hosts?show_service=true&search=anim ullamco&limit=20&page=4
result
```json { "result": [ { "id": { "value": "Service
To list all sevices :
{{baseUrl}}/monitoring/services?search=anim ullamco&limit=20&page=4
result
```json { "result": [ { "id": 5, "description": "Ping", "display_name": "Ping", "state": 0, "check_attempt": "fugiat", "icon_image": "", "icon_image_alt": "", "last_check": "1950-07-23T18:20:41.714Z", "last_state_change": "1975-09-03T15:50:12.031Z", "max_check_attempts": 3, "output": "OK - 127.0.0.1 rta 0.025ms lost 0%\n", "state_type": 1, "criticality": 10, "status": { "code": { "value": "via CLAPI (command line)
Host
Doc : https://docs.centreon.com/docs/api/clapi/#show-13
Command :
centreon -u admin -p 'centreon' -o HOST -a show
Output example :Service
Doc : https://docs.centreon.com/docs/api/clapi/#show-13
Command :
centreon -u admin -p 'centreon' -o SERVICE -a show
Output example :IP scanner
Listed IP could be used to feed a network scanner in a second step.
Centron auto-discovery
doc : https://docs.centreon.com/docs/21.04/monitoring/discovery/introduction/
Centreon provide an auto-discovery wizard wich agregates serveral strategies (so have already been explained here) including :
Since the process is only avaible in a graphicall interface it's seems diffuclt to integrate it in cabestan. Thought :