You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
{
"result": [
{
"type": "service|host",
"short_type": "s|h",
"id": 12,
"name": "Ping",
"alias": null,
"fqdn": null,
"links": {
"uris": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"endpoints": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"externals": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"monitoring_server_name": "Central",
"icon": {
"id": 12,
"name": "memory",
"url": "/media/memory.png"
},
"parent": {
"type": "service|host",
"short_type": "s|h",
"id": 12,
"name": "Central",
"alias": "Host",
"fqdn": "127.0.0.1",
"links": {
"uris": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"endpoints": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"externals": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"status": {
"code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"severity_code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"icon": {
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"url": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
}
},
"status": {
"code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"severity_code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"in_downtime": false,
"acknowledged": false,
"severity_level": 1,
"duration": "2h 3m",
"last_status_change": "1968-09-17T11:25:54.916Z",
"last_time_with_no_issue": "1948-09-21T10:42:47.332Z",
"tries": "3/3 (H)",
"last_check": "1h 45m",
"information": "OK - Ping is ok",
"active_checks": true,
"passive_checks": true
},
{
"type": "service|host",
"short_type": "s|h",
"id": 12,
"name": "Ping",
"alias": null,
"fqdn": null,
"links": {
"uris": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"endpoints": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"externals": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"monitoring_server_name": "Central",
"icon": {
"id": 12,
"name": "memory",
"url": "/media/memory.png"
},
"parent": {
"type": "service|host",
"short_type": "s|h",
"id": 12,
"name": "Central",
"alias": "Host",
"fqdn": "127.0.0.1",
"links": {
"uris": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"endpoints": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"externals": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"status": {
"code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"severity_code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"icon": {
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"url": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
}
},
"status": {
"code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value"example output: "<Error: Too many levels of nesting to fake this schema>"
},
"severity_code": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"in_downtime": false,
"acknowledged": false,
"severity_level": 1,
"duration": "2h 3m",
"last_status_change": "1988-02-06T13:59:45.715Z",
"last_time_with_no_issue": "1962-03-02T03:57:21.464Z",
"tries": "3/3 (H)",
"last_check": "1h 45m",
"information": "OK - Ping is ok",
"active_checks": true,
"passive_checks": true
}
],
"meta": {
"page": 1,
"limit": 10,
"search": {},
"sort_by": {},
"total": 1
}
}
{
"result": [
{
"id": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"alias": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"display_name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"state": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"services": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"poller_id": 1,
"acknowledged": false,
"address_ip": "127.0.0.1",
"check_attempt": 1,
"checked": true,
"execution_time": 0.070906,
"icon_image": "ppm/operatingsystems-linux-snmp-linux-128.png",
"icon_image_alt": "",
"last_check": "1977-12-07T09:39:29.803Z",
"last_hard_state_change": "1946-08-17T07:02:08.802Z",
"last_state_change": "1979-06-02T20:48:41.737Z",
"last_time_down": "1998-03-17T14:10:08.840Z",
"last_time_unreachable": "2010-06-05T10:24:29.826Z",
"last_time_up": "1970-01-18T13:10:58.364Z",
"last_update": "1984-12-27T21:31:43.738Z",
"max_check_attempts": 3,
"output": "OK - 127.0.0.1 rta 0.100ms lost 0%\n",
"passive_checks": false,
"state_type": 0,
"timezone": ":Europe/Paris",
"scheduled_downtime_depth": 0,
"criticality": 10
},
{
"id": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"alias": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"display_name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"name": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"state": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"services": {
"value": "<Error: Too many levels of nesting to fake this schema>"
},
"poller_id": 1,
"acknowledged": false,
"address_ip": "127.0.0.1",
"check_attempt": 1,
"checked": true,
"execution_time": 0.070906,
"icon_image": "ppm/operatingsystems-linux-snmp-linux-128.png",
"icon_image_alt": "",
"last_check": "1950-04-07T07:55:00.342Z",
"last_hard_state_change": "1971-07-22T10:48:45.658Z",
"last_state_change": "1961-07-27T12:14:07.261Z",
"last_time_down": "2007-05-29T09:31:12.846Z",
"last_time_unreachable": "1976-05-23T01:01:58.990Z",
"last_time_up": "1981-08-04T06:24:38.138Z",
"last_update": "1986-09-01T16:47:13.386Z",
"max_check_attempts": 3,
"output": "OK - 127.0.0.1 rta 0.100ms lost 0%\n",
"passive_checks": false,
"state_type": 0,
"timezone": ":Europe/Paris",
"scheduled_downtime_depth": 0,
"criticality": 10
}
],
"meta": {
"page": 1,
"limit": 10,
"search": {},
"sort_by": {},
"total": 1
}
}
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
Host
To list all host :
{{baseUrl}}/monitoring/hosts?show_service=true&search=anim ullamco&limit=20&page=4
result
Service
To list all sevices :
{{baseUrl}}/monitoring/services?search=anim ullamco&limit=20&page=4
result
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 :
The text was updated successfully, but these errors were encountered: