-1

I currently have the code

object Host "rqbhost" {
address = "xx.xx.xx.xx"
check_command = "hostalive"
}

object Service "ping4" {
host_name = "rqbhost"
check_command = "ping4"
}

object Service "http" {
host_name = "rqbhost"
check_command = "http"
}

This will not allow me to start the icinga service, and the error logs do not let me know of why they are incorrect. I have tried the documentation for icinga2 but it has been woefully unhelpful for such a simple task as mine.

the error logs here

:/etc/icinga2/conf.d/services.conf(25):  */
:/etc/icinga2/conf.d/services.conf(26): apply Service "ping4" {
:^^^^^^^^^^^^^^^^^^^^^
:/etc/icinga2/conf.d/services.conf(27):   import "generic-service"
:/etc/icinga2/conf.d/services.conf(28):
:[2016-07-08 13:59:24 +0000] critical/config: 1 error
:icinga2.service: control process exited, code=exited status=1
spoon_man
  • 11
  • 3
  • Maybe you should provide the error logs then? – gxx Jul 08 '16 at 13:55
  • I edited and added a pastebin. I solved the problem. Ping4 is not a service that I have in my system for some reason. I am not sure why it is in the documentation on icinga's site. I will answer the question. – spoon_man Jul 08 '16 at 14:05
  • Please put the error log **into** your question, to prevent link rot. – gxx Jul 08 '16 at 14:09
  • Invoke a manual config validation (icinga2 daemon -C) and add that. Your output from systemd is pretty much scrambled and removes important details. – dnsmichi Aug 10 '16 at 18:10

1 Answers1

1

Ping4 is not a service I have installed. It was listed as an example on the icinga2 documentation page. The syntax to monitor if a host is alive (and nothing more) in Icinga2 is as follows.

object Host "NAME" { /*ID of the ip/location/host you want to monitor*/
address = "xxx.xxx.xxx.xxx" /*IP address of the host*/
check_command = "hostalive" /*checks if alive*/
}
object Service "http" { /*checks for service http and its status*/
host_name = "NAME" /*which host you want to see*/
check_command = "http"/*checks if http is up*/
}

If that is in your /etc/icinga2/conf.d/ you will save as FILENAME.conf

Restart with systemctl restart icinga2 and the new host will be available to monitor in the web interface.

spoon_man
  • 11
  • 3