Kevi_N
(Kevin Nechodom)
July 1, 2020, 9:59am
1
Hello, I have problem with check disk from second VPS.
My config in file here:
* Host definitions with object attributes
* used for apply rules for Service, Notification,
* Dependency and ScheduledDowntime objects.
*
* Tip: Use `icinga2 object list --type Host` to
* list all host objects after running
* configuration validation (`icinga2 daemon -C`).
*/
/*
* This is an example host based on your
* local host's FQDN. Specify the NodeName
* constant in `constants.conf` or use your
* own description, e.g. "db-host-1".
*/
object Host NodeName {
/* Import the default host template defined in `templates.conf`. */
import "generic-host"
/* Specify the address attributes for checks e.g. `ssh` or `http`. */
address = "127.0.0.1"
address6 = "::1"
/* Set custom attribute `os` for hostgroup assignment in `groups.conf`. */
vars.os = "Linux"
/* Define http vhost attributes for service apply rules in `services.conf`. */
vars.http_vhosts["http"] = {
http_uri = "/"
}
/* Uncomment if you've sucessfully installed Icinga Web 2. */
//vars.http_vhosts["Icinga Web 2"] = {
// http_uri = "/icingaweb2"
//}
/* Define disks and attributes for service apply rules in `services.conf`. */
vars.disks["disk"] = {
/* No parameters. */
}
vars.disks["disk /"] = {
disk_partitions = "/"
}
/* Define notification mail attributes for notification apply rules in `notifications.conf`. */
vars.notification["mail"] = {
/* The UserGroup `icingaadmins` is defined in `users.conf`. */
groups = [ "icingaadmins" ]
}
}
object Host "Testovaci_prostredi" {
address = "xxx.xxx.xxx.xxx"
check_command = "hostalive"
}
object Service "http1" {
host_name = "Testovaci_prostredi"
check_command = "http"
}
object Service "apt1" {
host_name = "Testovaci_prostredi"
check_command = "apt"
}
object Service "ssh1" {
host_name = "Testovaci_prostredi"
check_command = "ssh"
}
object Service "disk1" {
import "generic-service"
host_name = "Testovaci_prostredi"
check_command = "disk"
}
object Service "load1" {
host_name = "Testovaci_prostredi"
check_command = "load"
}
object Service "users1" {
host_name = "Testovaci_prostredi"
check_command = "users"
}
object Service "icinga1" {
host_name = "Testovaci_prostredi"
check_command = "icinga"
}
object Service "testovaci.xxx.cz" {
host_name = "Testovaci_prostredi"
check_command = "http"
}
object Service "testovacieshop.xxx.cz" {
host_name = "Testovaci_prostredi"
check_command = "http"
}
object Service "testovaciwiki.xxx.cz" {
host_name = "Testovaci_prostredi"
check_command = "http"
}
object Service "MYSQL_databaze" {
host_name = "Testovaci_prostredi"
check_command = "http"
}
In Icinga2 on web I can see this (local disk):
External disk:
Please help me…
log1c
July 1, 2020, 10:04am
2
Hi and welcome
Just some quick tips for posting:
You can simply paste images into the editor and they will be uploaded and displayed in your post. No need for external image hosting
Also I would suggest you obscure your domain/employer name, just to be safe.
Config snippets can also be posted in the thread directly and encase with backticks (```)
Here is a good HowTo on posting
Edit and write topics
Discourse uses Markdown as markup language. If you are familiar with GitHub, you’re good to go. If not, please follow this guide .
[48]
While you type something into the editor, you’ll recognize many things:
live preview as you type on the right side
if someone else is replying, a short notice on top of the editor
you can navigate to a different page, and still reply to the “old” topic
sessions are stored, which means that a draft text can be started on your Macbook…
1 Like
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:04am
3
I´m sorry. I will rework my post.
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:11am
4
Now is everything alright?
1 Like
Pooh
(Antony Stone)
July 1, 2020, 10:14am
5
Firstly, please can you explain what your subject line “How to connect two
servers together to watch out after all?” means.
Secondly, I’m assuming you have the Icinga Agent installed on the VPS yo’re
trying to monitor - is that correct?
Finally, have you defined “command_endpoint = host.name” to make sure that the
check is performed on the VPS and not on the Icinga Master?
Antony.
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:18am
6
1, I´m sorry, im learning with this community forum.
2, Yes, I have installed Icinga2 agent on both VPS servers. (Icinga2Web too)
3, No, I don´t defined it, I´ll try it and reply you.
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:22am
7
Nope, it doesn´t work.
Output after I type “icinga2 daemon -C” to console.
critical/config: Error: Validation failed for object 'Testovaci_prostredi' of type 'Host'; Attribute 'command_endpoint': Object 'xxx.xxx.xxx.xxx' of type 'Endpoint' does not exist.
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:31am
8
My zones.conf
* Endpoint and Zone configuration for a cluster setup
* This local example requires `NodeName` defined in
* constants.conf.
*/
object Endpoint NodeName {
host = NodeName
}
object Zone ZoneName {
endpoints = [ NodeName ]
}
/*
* Defines a global zone containing templates,
* etc. synced to all nodes, if they accept
* configuration. All remote nodes need
* this zone configured too.
*/
/*
object Zone "global-templates" {
global = true
}
*/
/*
* Read the documentation on how to configure
* a cluster setup with multiple zones.
*/
/*
object Endpoint "Produkce" {
host = "xxx.xxx.xxx.xxx"
}
object Endpoint "Testovaci_prostredi" {
host = "xxx.xxx.xxx.xxx"
}
object Zone "master" {
endpoints = [ "Produkce" ]
}
object Zone "satellite" {
parent = "master"
endpoints = [ "Testovaci_prostredi" ]
}
*/ ```
Pooh
(Antony Stone)
July 1, 2020, 10:49am
9
All of the following are commented out (with /* and */ )
object Endpoint “Produkce”
object Endpoint “Testovaci_prostredi”
object Zone “master”
object Zone “satellite”
That means they are not defined as far as Icinga is concerned.
Antony.
Kevi_N
(Kevin Nechodom)
July 1, 2020, 10:55am
10
I uncomment it and this write me after I want to start Icinga2.