Invoke-IcingaCheckTimeSync - negative time range


i just started to use the check “Invoke-IcingaCheckTimeSync” and my brain is smoking :smiley:
I threw the ifw basked into the icinga2 director (big <3 for this btw!) and attached a check against the command with critical, warning arguments and ofc a ntp server.

template Service "NTP" {
    check_command = "Invoke-IcingaCheckTimeSync"
    check_interval = 1h
    command_endpoint = host_name
    vars.IcingaCheckTimeSync_Int32_Verbosity = "2"
    vars.IcingaCheckTimeSync_Object_Critical = "5s"
    vars.IcingaCheckTimeSync_Object_Warning = "2s"
    vars.IcingaCheckTimeSync_String_Server = ""

So far so easy, but i messed with the argument ranges.

[CRITICAL] Time Package [CRITICAL] Time Offset (-10ms)
[OK] Sync Status: NoLeapWarning \_ 
[CRITICAL] Time Offset: -10ms is greater than threshold 5s \_ 
[OK] Time Service: Running

I read the arg-table at Icinga Plugins - Icinga for Windows for about 10 times but i cant figure out how to get the Warn/Crit parameters right.

Could you help me please? :slight_smile:



I blame Microsoft as I get negative timestamps also in file age checks :roll_eyes:

Thresholds can go into the negative -1:5

Hey Dominik,

i’m kinda ok with having negative times regarding ntp… i can run behind or ahead an other timeserver… something my mind can follow…

Setting warn / crit to -2s:2s and -5s:5s made the check freak out :smiley:

[UNKNOWN] Time Package [UNKNOWN] Time Offset (0us)
\_ [OK] Sync Status: NoLeapWarning
\_ [UNKNOWN] Time Offset: Invalid range specified for threshold: InputValue "0" and Threshold -2s:2s
\_ [OK] Time Service: Running

Then I guess it isn’t a range at all because I would guess if it was, it would utilize a library so no bugs about negativity should be present. In your place, I would now have a look at the source code.

Hey. Is there a fix now? I have the same issue.