No services found matching the filter. | No services found matching the filter. Icingaweb

Hello, I am configuring icinga2, he configured the zones for a “MASTER” and an “AGENT” and the use of the ice agent to connect a windows client computer, I have connection to the certificates but when entering the http : // xxxx / icingaweb2 in any tag or drop-down shows me only the error:
No services were found that match the filter.
No services were found that match the filter.

Hi & welcome to the icinga community,

Zones have nothing to do with host or services objects. That means you need to create host and services objects additionally. This can be done via director or conf files.

Hello and thank you for the reply, i will try to do in conf files, but i think the icinga agent give the information to the master.

The master need to have that host object. Otherwise it would decline messages from that agent.

i add in te /etc/icinga2/conf.d/hosts.conf
}
object Endpoint “localhost.localdomain” {
}

object Zone “icinga” {
endpoints = [ “localhost.localdomain” ]
}
object Host “Example1” {
import “generic-host”
address = “192.168.222.123”
check_command = “hostalive”
}
object service “http” {
host_name = “Example1”
check_command = “http”
}

then i restart icinga2, httpd and mysqld, but i give the same problem.

imagen

Endpoint and zone objects shall be configured in /etc/icinga2/zones.conf only.

If you want to have conf files in /etc/icinga2/conf.d/ you need to make sure that this directory wasn’t excluded during running icinga node wizard. If so you need to modify /etc/icinga2/icinga2.conf and uncomment

#include_recursive “conf.d”

Error:
– Unit icinga2.service has begun starting up.
feb 06 09:42:54 localhost.localdomain icinga2[5398]: [2020-02-06 09:42:54 +0100] information/cli: Icinga application loader (version: 2.11.2
feb 06 09:42:54 localhost.localdomain icinga2[5398]: [2020-02-06 09:42:54 +0100] information/cli: Loading configuration file(s).
feb 06 09:42:54 localhost.localdomain icinga2[5398]: [2020-02-06 09:42:54 +0100] critical/config: Error: Object ‘client-pki-ticket’ of type
feb 06 09:42:54 localhost.localdomain icinga2[5398]: Location: in /etc/icinga2/conf.d/api-users.conf: 5:1-5:34
feb 06 09:42:54 localhost.localdomain icinga2[5398]: /etc/icinga2/conf.d/api-users.conf(3): */
feb 06 09:42:54 localhost.localdomain icinga2[5398]: /etc/icinga2/conf.d/api-users.conf(4):
feb 06 09:42:54 localhost.localdomain icinga2[5398]: /etc/icinga2/conf.d/api-users.conf(5): object ApiUser “client-pki-ticket” {
feb 06 09:42:54 localhost.localdomain icinga2[5398]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 06 09:42:54 localhost.localdomain icinga2[5398]: /etc/icinga2/conf.d/api-users.conf(6): password = "6abb054f0c369cde52cd1c7b9f8005991820
feb 06 09:42:54 localhost.localdomain icinga2[5398]: /etc/icinga2/conf.d/api-users.conf(7): permissions = [ “actions/generate-ticket” ]
feb 06 09:42:54 localhost.localdomain icinga2[5398]: [2020-02-06 09:42:54 +0100] critical/cli: Config validation failed. Re-run with 'icinga
feb 06 09:42:54 localhost.localdomain systemd[1]: icinga2.service: main process exited, code=exited, status=1/FAILURE
feb 06 09:42:54 localhost.localdomain systemd[1]: Failed to start Icinga host/service/network monitoring system.

My configuration file in: /etc/icinga2/conf.d/hosts.conf
/*

  • 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 variable 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 “DESKTOP-KAJDKSR” {

    address = "192.168.222.123"
    check_command = "hostalive"

}
my configuration file in . /etc/icinga2/conf.d/services.conf
/*

  • Service apply rules.
  • The CheckCommand objects ping4, ping6, etc
  • are provided by the plugin check command templates.
  • Check the documentation for details.
  • Tip: Use icinga2 object list --type Service to
  • list all service 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”.
    */

/*

  • These are generic ping4 and ping6
  • checks applied to all hosts having the
  • address resp. address6 attribute
  • defined.
    */
    apply Service “ping4” {
    import “generic-service”

check_command = “ping4”

assign where host.address
}

apply Service “ping6” {
import “generic-service”

check_command = “ping6”

assign where host.address6
}

/*

  • Apply the ssh service to all hosts
  • with the address attribute defined and
  • the custom variable os set to Linux.
    */
    apply Service “ssh” {
    import “generic-service”

check_command = “ssh”

assign where (host.address || host.address6) && host.vars.os == “Linux”
}

apply Service for (http_vhost => config in host.vars.http_vhosts) {
import “generic-service”

check_command = “http”

vars += config
}

apply Service for (disk => config in host.vars.disks) {
import “generic-service”

check_command = “disk”

vars += config
}

apply Service “icinga” {
import “generic-service”

check_command = “icinga”

assign where host.name == NodeName
}

apply Service “load” {
import “generic-service”

check_command = “load”

/* Used by the ScheduledDowntime apply rule in downtimes.conf. */
vars.backup_downtime = “02:00-03:00”

assign where host.name == NodeName
}

apply Service “procs” {
import “generic-service”

check_command = “procs”

assign where host.name == NodeName
}

apply Service “swap” {
import “generic-service”

check_command = “swap”

assign where host.name == NodeName
}

apply Service “users” {
import “generic-service”

check_command = “users”

assign where host.name == NodeName
}

my configuration file in: /etc/icinga2/conf.d/api-users.conf
/**

  • The ApiUser objects are used for authentication against the API.
    /
    object ApiUser “root” {
    password = "
    ***"
    // client_cn = “”

permissions = [ “*” ]
}
object ApiUser “client-pki-ticket” {
password = “6abb054f0c369cde52cd1c7b9f80059918204771”
permissions = [ “actions/generate-ticke” ]
}

Could you please reformat your posting as described here.

i reformat the ticket, and when i tryy to restart icinga 2, icinga give me this error:

[root@localhost ~]# nano /etc/icinga2/conf.d/api-users.conf
[root@localhost ~]# systemctl restart icinga2
Job for icinga2.service failed because the control process exited with error code. See “systemctl status icinga2.service” and “journalctl -xe” for details.
[root@localhost ~]# systemctl restart icinga2
Job for icinga2.service failed because the control process exited with error code. See “systemctl status icinga2.service” and “journalctl -xe” for details.
[root@localhost ~]# icinga2 daemon -C
[2020-02-07 09:45:49 +0100] information/cli: Icinga application loader (version: 2.11.2-1)
[2020-02-07 09:45:49 +0100] information/cli: Loading configuration file(s).
[2020-02-07 09:45:49 +0100] critical/config: Error: Object ‘client-pki-ticket’ of type ‘ApiUser’ re-defined: in /etc/icinga2/conf.d/api-users.conf: 5:1-5:34; previous definition: in /etc/icinga2/conf.d/api-users.conf: 5:1-5:34
Location: in /etc/icinga2/conf.d/api-users.conf: 5:1-5:34
/etc/icinga2/conf.d/api-users.conf(3): */
/etc/icinga2/conf.d/api-users.conf(4):
/etc/icinga2/conf.d/api-users.conf(5): object ApiUser “client-pki-ticket” {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/etc/icinga2/conf.d/api-users.conf(6): password = “6abb054f0c369cde52cd1c7b9f80059918204771”
/etc/icinga2/conf.d/api-users.conf(7): permissions = [ “actions/generate-ticke” ]

[2020-02-07 09:45:49 +0100] critical/cli: Config validation failed. Re-run with ‘icinga2 daemon -C’ after fixing the config.

i fix it, but my principal error is the same other time, i cant see the object nad services.

error:

In general I’d recommend to run

icinga2 daemon -C

after any change at least before trying a reload. (here is BTW an example of well formatted text)

Could you share your api-users.conf as icinga complains an error:

Error: Object ‘client-pki-ticket’ of type ‘ApiUser’ re-defined

(for well formatted conf files please use three backticks before and after each file)

oki, before i install the agent in a windows machine, in this file confguration i have:

object ApiUser “roott” {
password = “xxxx”
permissions = [ “*” ]
}
but now after the isntallation i have:

object ApiUser “client-pki-ticket” {
password = “6abb054f0c369cde52cd1c7b9f80059918204771”
permissions = [ “actions/generate-ticke” ]
}