Getting HTTP 400 Bad Request when configuring the API

Hi,

I’m trying to configure the REST API and getting the following error -

here is host file -

object Host “monhiem” {

address = “xxxxxxxxxxxxx”
vars.os = “Linux”
vars.web443 = true
check_command = “hostalive”
event_command = “send_to_businesstool”
vars.hosting[“http”] = {
http_uri = “/api/cities”
}
}

object EventCommand “send_to_businesstool” {
command = [
“/usr/bin/curl”,
“-s”,
“-X GET”
]
arguments = {
“-H” = {
value ="$businesstool_url$"
}
}
vars.businesstool_url = “https://xxxxxxxxxxxx/api/cities
}

object Service “checking” {
host_name = “monhiem”

check_command = “hostalive”

event_command = “send_to_businesstool”
}

and service file -

apply Service “web443” {
import “generic-service”
display_name = “web443”
check_command = “http”
vars.http_port = “443”
vars.http_timeout = “10”
assign where host.vars.web443 == true
}

can someone help me out here?

Thanks,
Shashil

can you check the Inspect link inside the service please.

Here is the screenshot for the inspect.

Here, is much more details of the Object Properties

Last Check Result

Executed Command

‘/usr/lib/nagios/plugins/check_http’ ‘-I’ ‘xxxxxxxxxxxxxxx’ ‘-p’ ‘443’ ‘-t’ ‘10’

Object Properties

__name “monhiem!web443”
acknowledgement 0
acknowledgement_expiry 0
action_url “”
active true
check_attempt 1
check_command http
check_interval 60
check_period “”
check_timeout null
command_endpoint “”
display_name “web443”
downtime_depth 0
enable_active_checks true
enable_event_handler true
enable_flapping false
enable_notifications true
enable_passive_checks true
enable_perfdata true
event_command “”
flapping false
flapping_current 0
flapping_last_change 0
flapping_threshold 0
flapping_threshold_high 30
flapping_threshold_low 25
force_next_check false
force_next_notification false
groups http
ha_mode 0
handled false
host_name “monhiem”
icon_image “”
icon_image_alt “”
last_check 1594729891.464876
last_hard_state 1
last_hard_state_change 1594718256.884779
last_reachable true
last_state 1
last_state_change 1594718170.047451
last_state_critical 0
last_state_ok 0
last_state_type 1
last_state_unknown 0
last_state_unreachable 0
last_state_warning 1594729891.464884
max_check_attempts 5
name “web443”
next_check 1594729951.460000
notes “”
notes_url “”
original_attributes null
package “_etc”
paused false
previous_state_change 1594718170.047451
problem true
retry_interval 30
severity 40
state 1
state_type 1
type “Service”
vars { http_port: “443”, http_timeout: “10” }
version 0
volatile false
zone “”

ERROR LOG when I hit check now