Page 1 of 1

5.5.2 API wrong state_type

Posted: Fri Aug 24, 2018 3:03 am
by sib
Hi

Eventhough the alert is CRITICAL and HARD state, the API shows a state_type = 1 which I guess is supposed to be SOFT

Code: Select all

{
            "@attributes": {
                "id": "1210038"
            },
            "instance_id": "1",
            "service_id": "3874",
            "host_id": "3856",
            "host_name": "lbnss1249",
            "host_alias": "Default Host",
            "name": "NRPE Service",
            "host_display_name": {
                
            },
            "host_address": "10.55.65.60",
            "display_name": "Please contact Linux support:Linux",
            "status_update_time": "2018-08-24 09:55:04",
            "status_text": "(No output on stdout) stderr: connect to address 10.55.65.60 port 5666: Connection refused",
            "status_text_long": "connect to host 10.55.65.60 port 5666: Connection refused",
            "current_state": "2",
            "performance_data": {
                
            },
            "should_be_scheduled": "1",
            "check_type": "0",
            "last_state_change": "2018-08-24 09:54:17",
            "last_hard_state_change": "2018-08-24 09:54:27",
            "last_hard_state": "2",
            "last_time_ok": "2018-08-24 09:54:17",
            "last_time_warning": "1970-01-01 01:00:00",
            "last_time_critical": "2018-08-24 09:54:27",
            "last_time_unknown": "2018-03-13 09:08:35",
            "last_notification": "2018-08-24 09:54:27",
            "next_notification": "2018-08-24 09:54:27",
            "no_more_notifications": "1",
            "acknowledgement_type": "0",
            "current_notification_number": "9",
            "process_performance_data": "1",
            "obsess_over_service": "1",
            "event_handler_enabled": "1",
            "modified_service_attributes": "1",
            "event_handler": {
                
            },
            "check_command": "check_nrpe_alive!!!!!!!!",
            "normal_check_interval": "1",
            "retry_check_interval": "1",
            "check_timeperiod_id": "117",
            "icon_image": {
                
            },
            "icon_image_alt": {
                
            },
            "has_been_checked": "1",
            "current_check_attempt": "2",
            "max_check_attempts": "2",
            "last_check": "2018-08-24 09:54:27",
            "next_check": "2018-08-24 09:55:26",
            "state_type": "1",
            "notifications_enabled": "1",
            "problem_acknowledged": "0",
            "flap_detection_enabled": "0",
            "is_flapping": "0",
            "percent_state_change": "27.43421",
            "latency": "0.00004",
            "execution_time": "0.00615",
            "scheduled_downtime_depth": "0",
            "passive_checks_enabled": "1",
            "active_checks_enabled": "1",
            "notes_url": {
                
            },
            "action_url": {
                
            }
        },

Re: 5.5.2 API wrong state_type

Posted: Fri Aug 24, 2018 10:04 am
by lmiltchev
Eventhough the alert is CRITICAL and HARD state, the API shows a state_type = 1 which I guess is supposed to be SOFT
state_type = 0 is SOFT
state_type = 1 is HARD

You can also check the value in the status.dat, which should match the one, found in the REST API.