It is an option. Just change the time format specification. Google for "strftime format" and use any format you want. For 24 hrs, it would be "%H:%M" and change the from and to fields to 24 hr format. As far as the other rule is concerned, just delete it.
ES 6.0: Rules engine for notifications
Re: ES 6.0: Rules engine for notifications
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Thanks for the reply.
I've amended the time format and converted my times to 24 hour clock.
I managed to delete the second mute. It's simple with JSON expertise (which I don't have) but knowing where to stop, which brace, do I still need the comma, these are the challenges. I used a chop and JSON validate method and that worked out.
It's working for the ZMNinja notifications too.
I've amended the time format and converted my times to 24 hour clock.
I managed to delete the second mute. It's simple with JSON expertise (which I don't have) but knowing where to stop, which brace, do I still need the comma, these are the challenges. I used a chop and JSON validate method and that worked out.
It's working for the ZMNinja notifications too.
-
Re: ES 6.0: Rules engine for notifications
Ok great. Thanks for testing!
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
It doesn't care about the daysofweek and is still muting today (Sunday).
CONSOLE INF:2020-09-13,12:10:26 |----> FORK:Shed2 (12), eid:223247 Event 223247 for Monitor 12 has finished
CONSOLE DBG-1:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: (eid: 223247) -- Processing rule: 1 --
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: parsing rule 06:30/22:00 using format:%H:%M
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: parsed time from: Thu Jan 1 06:30:00 1970 and to:Thu Jan 1 22:00:00 1970
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules:(eid: 223247) seeing if now:12:10 is between:06:30 and 22:00
CONSOLE DBG-1:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: (eid: 223247) mute rule matched, not allowing
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: Not processing start notifications as rules checks failed
CONSOLE INF:2020-09-13,12:10:26 |----> FORK:Shed2 (12), eid:223247 Event 223247 for Monitor 12 has finished
CONSOLE DBG-1:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: (eid: 223247) -- Processing rule: 1 --
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: parsing rule 06:30/22:00 using format:%H:%M
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: parsed time from: Thu Jan 1 06:30:00 1970 and to:Thu Jan 1 22:00:00 1970
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules:(eid: 223247) seeing if now:12:10 is between:06:30 and 22:00
CONSOLE DBG-1:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: (eid: 223247) mute rule matched, not allowing
CONSOLE DBG-2:2020-09-13,12:10:28 |----> FORK:Shed2 (12), eid:223247 rules: Not processing start notifications as rules checks failed
-
Re: ES 6.0: Rules engine for notifications
1. Could you please update ES
2. Please make sure you are using the key "daysofweek" to specify days (In the past, I was using "dow" somewhere in error)
2. Please make sure you are using the key "daysofweek" to specify days (In the past, I was using "dow" somewhere in error)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Thanks for the quick response.
I've updated and it's still behaving a bit strangely. It seems to think it is Thursday today if I understand correctly. First day of the Epoch too.
I've updated and it's still behaving a bit strangely. It seems to think it is Thursday today if I understand correctly. First day of the Epoch too.
Code: Select all
CONSOLE DBG-1:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules: (eid: 223265) -- Processing rule: 1 --
CONSOLE DBG-2:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules: parsing rule 06:30/22:00 using format:%H:%M
CONSOLE DBG-2:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules: parsed time from: Thu Jan 1 06:30:00 1970 and to:Thu Jan 1 22:00:00 1970
CONSOLE DBG-2:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules:(eid: 223265) seeing if now:13:58 is between:06:30 and 22:00
CONSOLE DBG-2:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules:(eid: 223265) seeing if now:Thu matches:Mon,Tue,Wed,Thu,Fri
CONSOLE DBG-1:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules: (eid: 223265) mute rule matched, not allowing
CONSOLE DBG-2:2020-09-13,13:58:36 |----> FORK:Shed2 (12), eid:223265 rules: Not processing start notifications as rules checks failed
-
Re: ES 6.0: Rules engine for notifications
Uh oh, that's right. It's a bug. Will fix it.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Please update and try (you'll still see 1970 but day of week should work as expected)
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Hmmm. Seems to believe today is Thursday if I understand correctly. It's already muted based on time, however. I can drop Thur out of the json and see what occurs next.
Code: Select all
CONSOLE DBG-2:2020-09-14,06:57:42 |----> FORK:Shed2 (12), eid:223320 rules:(eid: 223320) seeing if now:06:57 is between:06:30 and 22:00
CONSOLE DBG-2:2020-09-14,06:57:42 |----> FORK:Shed2 (12), eid:223320 rules:(eid: 223320) seeing if now:Thu matches:Mon,Tue,Wed,Thu,Fri
CONSOLE DBG-1:2020-09-14,06:57:42 |----> FORK:Shed2 (12), eid:223320 rules: (eid: 223320) mute rule matched, not allowing
-
Re: ES 6.0: Rules engine for notifications
Dropping out Thu just leaves it the time and it's happy to match on that and mute (incorrectly). Feels like it matches OR instead of AND.
Code: Select all
CONSOLE DBG-2:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules: parsing rule 10:30/22:00 using format:%H:%M
CONSOLE DBG-2:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules: parsed time from: Thu Jan 1 10:30:00 1970 and to:Thu Jan 1 22:00:00 1970
CONSOLE DBG-2:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules:(eid: 223349) seeing if now:10:59 is between:10:30 and 22:00
CONSOLE DBG-2:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules:(eid: 223349) seeing if now:Thu matches:Mon,Tue,Wed,Fri
CONSOLE DBG-1:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules: (eid: 223349) mute rule matched, not allowing
CONSOLE DBG-2:2020-09-14,10:59:06 |----> FORK:Shed2 (12), eid:223349 rules: Not processing start notifications as rules checks failed
-
Re: ES 6.0: Rules engine for notifications
What is the output of this sample program?
Assuming you save it as foo.pl, you can run it by doing
Is the output correct?
Code: Select all
use Time::Piece;
my $now = Time::Piece->new;
print ("Date is $now\n");
print ("Weekday is ".$now->wdayname."\n");
Code: Select all
perl ./foo.pl
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Also ,there was a logging error in ES - please update.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: ES 6.0: Rules engine for notifications
Here's the Perl bit -
Correct fror my TZ.
I'll update ES once I've eaten.
Code: Select all
perl ./foo.pl
Date is Mon Sep 14 12:34:47 2020
Weekday is Mon
I'll update ES once I've eaten.
-