Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten


1. Hole ein Kommando per ID

URL: https://123.123.123.123/commands/$ID.json

Methode: GET

Antwort: JSON


Antwort auf erfolgreiche API Abfrage
{
    "command": {
        "Command": {
            "id": "17",
            "name": "check_local_disk",
            "command_line": "$USER1$\/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$",
            "command_type": "1",
            "human_args": null,
            "uuid": "74a59dd0-2eff-4f41-9bcd-3e8786f34f04",
            "description": "This plugin checks the amount of used disk space on a mounted file system\r\nand generates an alert if free space is less than one of the threshold values"
        },
        "Commandargument": [
            {
                "id": "23",
                "command_id": "17",
                "name": "$ARG1$",
                "human_name": "Warning (%)",
                "created": "2015-01-15 23:36:34",
                "modified": "2015-01-15 23:36:34"
            },
            {
                "id": "24",
                "command_id": "17",
                "name": "$ARG2$",
                "human_name": "Critical (%)",
                "created": "2015-01-15 23:36:34",
                "modified": "2015-01-15 23:36:34"
            },
            {
                "id": "25",
                "command_id": "17",
                "name": "$ARG3$",
                "human_name": "Moint point",
                "created": "2015-01-15 23:36:34",
                "modified": "2015-01-15 23:36:34"
            }
        ]
    }
}


2. Hole alle existierenden Kommandos

URL: https://123.123.123.123/commands.json

Methode: GET

Antwort: JSON


Antwort auf erfolgreiche API Abfrage
{
    "all_commands": [
        {
            "Command": {
                "id": "3",
                "name": "check_ping",
                "command_line": "$USER1$\/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5",
                "command_type": "1",
                "human_args": null,
                "uuid": "cdd9ba25-a4d8-4261-a551-32164d4dde14",
                "description": ""
            }
        },
        {
            "Command": {
                "id": "31",
                "name": "check-host-alive",
                "command_line": "$USER1$\/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1",
                "command_type": "2",
                "human_args": null,
                "uuid": "d8c30a28-acd3-4b67-9ede-ae3af1d0dec6",
                "description": null
            }
        }
    ]
}


3. Hole alle existierenden Host Check Kommandos

URL: https://123.123.123.123/commands/hostchecks.json

Methode: GET

Antwort: JSON


Antwort auf erfolgreiche API Abfrage
{
    "all_commands": [
        {
            "Command": {
                "id": "36",
                "name": "check-host-alive-smtp",
                "command_line": "$USER1$\/check_tcp -H $HOSTADDRESS$ -p 25 -w 3 -c 5",
                "command_type": "2",
                "human_args": null,
                "uuid": "e8008385-957d-4379-9ac0-579d60b35f65",
                "description": null
            }
        },
        {
            "Command": {
                "id": "31",
                "name": "check-host-alive",
                "command_line": "$USER1$\/check_icmp -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1",
                "command_type": "2",
                "human_args": null,
                "uuid": "d8c30a28-acd3-4b67-9ede-ae3af1d0dec6",
                "description": null
            }
        }
    ]
}




4. Hole alle existierenden Benachrichtigungskommandos

URL: https://123.123.123.123/commands/notifications.json

Methode: GET

Antwort: JSON


Antwort auf erfolgreiche API Abfrage
{
    "all_commands": [
        {
            "Command": {
                "id": "1",
                "name": "host-notify-by-cake",
                "command_line": "\/usr\/share\/openitcockpit\/app\/Console\/cake nagios_notification -q --type Host --notificationtype $NOTIFICATIONTYPE$ --hostname \"$HOSTNAME$\" --hoststate \"$HOSTSTATE$\" --hostaddress \"$HOSTADDRESS$\" --hostoutput \"$HOSTOUTPUT$\" --contactmail \"$CONTACTEMAIL$\" --contactalias \"$CONTACTALIAS$\"",
                "command_type": "3",
                "human_args": null,
                "uuid": "a13ff7f1-0642-4a11-be05-9931ca98da10",
                "description": "Send a host notification as mail"
            }
        },
        {
            "Command": {
                "id": "2",
                "name": "service-notify-by-cake",
                "command_line": "\/usr\/share\/openitcockpit\/app\/Console\/cake nagios_notification -q --type Service --notificationtype $NOTIFICATIONTYPE$ --hostname \"$HOSTNAME$\" --hoststate \"$HOSTSTATE$\" --hostaddress \"$HOSTADDRESS$\" --hostoutput \"$HOSTOUTPUT$\" --contactmail \"$CONTACTEMAIL$\" --contactalias \"$CONTACTALIAS$\" --servicedesc \"$SERVICEDESC$\" --servicestate \"$SERVICESTATE$\" --serviceoutput \"$SERVICEOUTPUT$\"",
                "command_type": "3",
                "human_args": null,
                "uuid": "a517bbb6-f299-4b57-9865-a4e0b70597e4",
                "description": "Send a service notificationa as mail"
            }
        }
    ]
}


5. Hole alle existierenden Event Handler Kommandos

URL: https://123.123.123.123/commands/handler.json

Methode: GET

Antwort: JSON


Antwort auf erfolgreiche API Abfrage
{
    "all_commands": [
        {
            "Command": {
                "id": "100",
                "name": "test handle",
                "command_line": "echo 1 >> /tmp/handler_test",
                "command_type": "4",
                "human_args": null,
                "uuid": "cf154b32-6a1d-4546-a337-260daa735ea9",
                "description": null
            }
        }
    ]
}
  • Keine Stichwörter