Hi all I managed to startup the daemon on the client windozzor2,
removing manually the row import "generic-host" in the file
C:\ProgramData\icinga2\var\lib\icinga2\api\zones\WINDOTTOR2.posinega.local\_etc\hosts.conf:

object Host "WINDOTTOR2.posinega.local" {
  address = "WINDOTTOR2.posinega.local"
  check_command = "hostalive"
  zone = "master"
  vars.os = "Windows"
}

So now the zone "global-templates" is available on the client windottor2 and 
the connection is correctly established:

root@goccia:~# lsof -i :5665
COMMAND   PID   USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
icinga2 11550 nagios   12u  IPv4 12874342      0t0  TCP *:5665 (LISTEN)
icinga2 11550 nagios   16u  IPv4 12874343      0t0  TCP 
goccia.posinega.local:5665->DEBCRASH.posinega.local:38638 (ESTABLISHED)
icinga2 11550 nagios   44u  IPv4 12883031      0t0  TCP 
goccia.posinega.local:5665->windottor2.posinega.local:60029 (ESTABLISHED)

But when i try to validate the configuration on windottor2 i get stuck with a 
crash, although the daemon is still running on the client 


C:\Program Files\ICINGA2\sbin>icinga2 daemon -C
information/cli: Icinga application loader (version: v2.5.4)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
information/ApiListener: My API identity: WINDOTTOR2.posinega.local
warning/ApplyRule: Apply rule 'mail-icingaadmin' (in C:\ProgramData\icinga2\var\
lib\icinga2\api\zones/global-templates/_etc/notifications.conf: 11:1-11:45) for
type 'Notification' does not match anywhere!
warning/ApplyRule: Apply rule 'mail-icingaadmin' (in C:\ProgramData\icinga2\var\
lib\icinga2\api\zones/global-templates/_etc/notifications.conf: 20:1-20:48) for
type 'Notification' does not match anywhere!
warning/ApplyRule: Apply rule 'apt' (in C:\ProgramData\icinga2\var\lib\icinga2\a
pi\zones/global-templates/_etc/apt.conf: 1:0-1:18) for type 'Service' does not m
atch anywhere!
warning/ApplyRule: Apply rule '' (in C:\ProgramData\icinga2\var\lib\icinga2\api\
zones/global-templates/_etc/services.conf: 1:0-1:52) for type 'Service' does not
 match anywhere!
warning/ApplyRule: Apply rule 'load' (in C:\ProgramData\icinga2\var\lib\icinga2\
api\zones/global-templates/_etc/services.conf: 10:1-10:20) for type 'Service' do
es not match anywhere!
warning/ApplyRule: Apply rule 'procs' (in C:\ProgramData\icinga2\var\lib\icinga2
\api\zones/global-templates/_etc/services.conf: 21:1-21:21) for type 'Service' d
oes not match anywhere!
warning/ApplyRule: Apply rule 'swap' (in C:\ProgramData\icinga2\var\lib\icinga2\
api\zones/global-templates/_etc/services.conf: 29:1-29:20) for type 'Service' do
es not match anywhere!
warning/ApplyRule: Apply rule 'users' (in C:\ProgramData\icinga2\var\lib\icinga2
\api\zones/global-templates/_etc/services.conf: 40:1-40:21) for type 'Service' d
oes not match anywhere!
information/ConfigItem: Instantiated 1 ApiUser.
information/ConfigItem: Instantiated 1 ApiListener.
information/ConfigItem: Instantiated 3 Zones.
information/ConfigItem: Instantiated 1 FileLogger.
information/ConfigItem: Instantiated 2 Endpoints.
information/ConfigItem: Instantiated 2 NotificationCommands.
information/ConfigItem: Instantiated 197 CheckCommands.
information/ConfigItem: Instantiated 1 Host.
information/ConfigItem: Instantiated 1 IcingaApplication.
information/ConfigItem: Instantiated 2 HostGroups.
information/ConfigItem: Instantiated 1 UserGroup.
information/ConfigItem: Instantiated 1 User.
information/ConfigItem: Instantiated 3 TimePeriods.
information/ConfigItem: Instantiated 3 ServiceGroups.
information/ConfigItem: Instantiated 1 CheckerComponent.
critical/Application: Icinga 2 has terminated unexpectedly. Additional informati
on can be found in 'C:\ProgramData\icinga2\var/log/icinga2/crash/report.14809465
46.515000'

C:\Program Files\ICINGA2\sbin>netstat -an | findstr 5665
  TCP    0.0.0.0:5665           0.0.0.0:0              LISTENING
  TCP    192.168.101.3:60029    192.168.101.4:5665     ESTABLISHED
  TCP    [::]:5665              [::]:0                 LISTENING

It seems the old version is been restored in the api zone files, so i enabled 
the api listener to accept command and query on windottor2, but when I try to 
force the cancellation of the object it fails:

root@goccia:~# curl -k -s -u root:___ -H 'Accept: application/json' 
'https://WINDOTTOR2:5665/v1/objects/hosts/WINDOTTOR2.posinega.local' | python 
-m json.tool
{
    "results": [
        {
            "attrs": {
                "__name": "WINDOTTOR2.posinega.local",
                "acknowledgement": 0.0,
                "acknowledgement_expiry": 0.0,
                "action_url": "",
                "active": true,
                "address": "WINDOTTOR2.posinega.local",
                "address6": "",
                "check_attempt": 1.0,
                "check_command": "hostalive",
                "check_interval": 60.0,
                "check_period": "",
                "check_timeout": null,
                "command_endpoint": "",
                "display_name": "WINDOTTOR2.posinega.local",
                "downtime_depth": 0.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_last_change": 1480938604.834,
                "flapping_negative": 2887.0,
                "flapping_positive": 0.0,
                "flapping_threshold": 30.0,
                "force_next_check": false,
                "force_next_notification": false,
                "groups": [
                    "windows-servers"
                ],
                "ha_mode": 0.0,
                "icon_image": "",
                "icon_image_alt": "",
                "last_check": 1480938604.834,
                "last_check_result": {
                    "active": true,
                    "check_source": "WINDOTTOR2.posinega.local",
                    "command": [
                        "C:\\Program Files\\ICINGA2\\/sbin/check_ping",
                        "-H",
                        "127.0.0.1",
                        "-c",
                        "5000,100%",
                        "-w",
                        "3000,80%"
                    ],
                    "execution_end": 1480938604.834,
                    "execution_start": 1480938599.748,
                    "exit_status": 0.0,
                    "output": "PING OK RTA: 0ms Packet loss: 0% ",
                    "performance_data": [
                        "rta=0ms;3000;5000;0;",
                        "pl=0%;80;100;0;100"
                    ],
                    "schedule_end": 1480938604.834,
                    "schedule_start": 1480938599.5900002,
                    "state": 0.0,
                    "type": "CheckResult",
                    "vars_after": {
                        "attempt": 1.0,
                        "reachable": true,
                        "state": 0.0,
                        "state_type": 1.0
                    },
                    "vars_before": {
                        "attempt": 1.0,
                        "reachable": true,
                        "state": 0.0,
                        "state_type": 1.0
                    }
                },
                "last_hard_state": 0.0,
                "last_hard_state_change": 1480935700.733,
                "last_in_downtime": false,
                "last_reachable": true,
                "last_state": 0.0,
                "last_state_change": 1480935700.733,
                "last_state_down": 0.0,
                "last_state_type": 1.0,
                "last_state_unreachable": 0.0,
                "last_state_up": 1480938604.834,
                "max_check_attempts": 3.0,
                "name": "WINDOTTOR2.posinega.local",
                "next_check": 1480941219.2749999,
                "notes": "",
                "notes_url": "",
                "original_attributes": null,
                "package": "_cluster",
                "paused": false,
                "retry_interval": 30.0,
                "state": 0.0,
                "state_type": 1.0,
                "templates": [
                    "WINDOTTOR2.posinega.local",
                    "generic-host"
                ],
                "type": "Host",
                "vars": {
                    "os": "Windows"
                },
                "version": 0.0,
                "volatile": false,
                "zone": "master"
            },
            "joins": {},
            "meta": {},
            "name": "WINDOTTOR2.posinega.local",
            "type": "Host"
        }
    ]
}
root@goccia:~# curl -k -s -u root:___ -H 'Accept: application/json' -X DELETE 
'https://WINDOTTOR2:5665/v1/objects/hosts/WINDOTTOR2.posinega.local' | python 
-m json.tool
{
    "results": [
        {
            "code": 500.0,
            "errors": [
                "Object cannot be deleted because it was not created using the 
API."
            ],
            "name": "WINDOTTOR2.posinega.local",
            "status": "Object could not be deleted.",
            "type": "Host"
        }
    ]
}


What can I do to drop/flush the host object WINDOTTOR2.posinega.local on the 
client, the object don't exist on the master anymore:

root@goccia:~# curl -k -s -u root:___ 
'https://goccia:5665/v1/objects/hosts/WINDOTTOR2.posinega.local' | python -m 
json.tool
{
    "error": 404.0,
    "status": "No objects found."
}
 

Thanks in advance for any idea..

Regards 

Luca Cazzaniga


_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to