Icinga2 -Object Service Defintion

HI team,

This is kind of a really basic question… I have been trying to add service to my icinga2 through object service… not the apply service… is it possible?

Here the configurations that i am making

---------------------------------host file--------------------------------

// Host Objects
object Host “******-02.######ANDCO.AWS” {
check_command = “hostalive”
address = “#########”
vars.os=“Windows”
vars.app_type=“db”
// Custom Optional check - START
vars.nscp_boot = false
vars.notification[“mail”] = {
groups = [ “icingausers” ]
users = [ “icingaadmin” ]
}
// Custom Optional Check - END
}

------------------------------Object Service check--------------------
object Service “uptime” {
host_name = “******-02.######ASANDCO.AWS”
check_command = “uptime-windows”
enable_notifications = false
command_endpoint = host.name

check_interval = 60s
}

When i applied these i see in icinga2…looking for plugin… here, the error that i see… Can you please advise?

Hi,
did you use the check-command “uptime-windows” from the ITL or did you redefine it?

object Host “******-02.######ANDCO.AWS” {

doesn’t match with

host_name = “******-02.######ASANDCO.AWS”

lol… i am using the same name… i am not worrying about the hostname…I am just worrying how object service definition is different from apply… if i want to proceed with object service… how do we add service to host? am i missing something or syntax is wrong?

Yes… Here the link https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#uptime-windows