Hello,
With an API command how to get only second-level information?
For ex:
https://IcingaServer.domaine:5665/v1/objects/services/ServerName!CPU413?attrs=last_check_result
Result :
{
“results”: [
{
“attrs”: {
“last_check_result”: {
“active”: true,
“check_source”: “IcingaServer.cma-cgm.com”,
“command”: [
“/opt/monitoring/plugins/check_cpu.sh”,
“-c”,
“90”,
“-w”,
“80”
],
“execution_end”: 1714998355.358391,
“execution_start”: 1714998354.286959,
“exit_status”: 0,
“output”: “OK - CPU Usage 54% used”,
“performance_data”: [
“CPU_total=54;80;90;;”,
“CPU_user=45;80;90;;”,
“CPU_system=9;80;90;;”,
“CPU_idle=46;;;;”,
“CPU_iowait=0;80;90;;”
],
“previous_hard_state”: 0,
“schedule_end”: 1714998355.358476,
“schedule_start”: 1714998354.286542,
…
But how do you write the command to get only the “output” line of the “last_check_result” attribute for example?
Thanks
- Director version : 1.9.1
- Icinga Web 2 version and modules : 2.11.1
- Icinga 2 version : 2.14-0.1
- Operating System and version: linux redhat 7.6
- Webserver, PHP versions: 7.3
- Icingadb : 1.0.1