how can I set time interval between two email notifications that Zabbix sends? I want to send a notification about an issue at least 30 minutes since the last email about the same issue.
Currently, I get an email every minute about the same thing and that's annoying.
The only thing I found was this: https://www.zabbix.com/forum/zabbix-help/19970-time-interval-between-two-email-notifications
but unfortunately it wasn't very helpful.
You can manage these intervals in Configuration -> Actions -> your alert action -> Operations.
I think that you have set up Default step duration to 1 minute and a notification action for steps 1 - 0 (Indefinitely).
In the documentation you can find various examples, for instance:
Example 1
Sending a repeated notification once every 30 minutes (5
times in total) to a 'MySQL Administrators' group.
To configure:
in Operations tab, set the Default operation step duration to '30m'
(30 minutes) Set the escalation steps to be From '1' To '5' Select the
'MySQL Administrators' group as recipients of the message
You can define a default step duration of 1 minute and define the escalations:
step 1 - 1 to send a mail after 1 minute
step 30 - 30 to send a mail after 30 minutes
or step 30 - 0 to send a mail every 30 minutes
Related
I have problems is: Auto-update order status if that status doesn't have any update in 30 days.
For example, the current status is " processing" and during 30days later, no more update on this. So the MySQL auto-update order status to "on Hold
I found and guest it something related to Hook, but I don't know how to implement it
depends on how you run you app. I'll suggest using e.g. some cron to get such instances and update it's status.(e.g. https://www.npmjs.com/package/node-cron)
Set it for example to run once a day, query such instances depends on build in column updatedAt. Or just to add some other column which will be updated with current date, depends what rules you want to apply
you can use cronjob.as npm says Cron is a tool that allows you to execute something on a schedule.
for install cron - 'npm i cron'
the (*) shows in order given details.
Seconds: 0-59 Minutes: 0-59 Hours: 0-23 Day of Month: 1-31 Months:
0-11 (Jan-Dec) Day of Week: 0-6 (Sun-Sat)
how to initialize cronjob:
var CronJob = require('cron').CronJob;
var job = new CronJob(
'* * * */30 * *',
function() {
console.log('every 30 days it is auto updated!');
},
null,
true,
'America/Los_Angeles'
);
make sure other parameters pass according to your application
and also cron use different port then your application.
As suggested by Damian you need to use a kind of CRON job which runs everyday to check for expired orders(created more than 30 days ago without any update).
You can use Bull with PM2
Create a processor in Bull and a queue and use the CRON functionality of Bull to set this job to run everyday usually at 12:05 AM or any time you see suitable.
The job would fetch all orders which have status "processing" and were created more than 30 days ago and update them.
Use PM2 to run Bull
I am using Google Apps Script to do something with Gmail messages. To retrieve messages within a specific time range, I use the GmailApp search method. It seems that Gmail will round up the timestamp of the messages to minutes so I could not get results which I would expect to have.
Let's say we have 3 messages with timestamps
2020-10-15 11:14:41
2020-10-15 11:38:49
2020-10-15 11:59:26
When I search the messages by query "after:1602759600 before:1602730800" (from 2020-10-15 11:00:00 to 2020-10-15 12:00:00), only 2 messages were returned. It seems that Gmail rounds up the timestamp of the messages to minutes, where the "11:59:26" message was treated as "12:00" (It also appears as "12:00" in the inbox of the Gmail page)
If I set the query to "after:1602730800 before:1602766800" (from 2020-10-15 12:00:00 to 2020-10-15 13:00:00), the message stamped with "2020-10-15 11:59:26" returned as the search result.
To investigate this, I sent another 2 messages to see how Gmail rounds up. I sent the messages at 12:59:15 and 12:59:45 respectively, this time Gmail rounds down the "12:59:15" to "12:59" and the "12:59:45" to "13:00".
Does anybody knows what is behind the box?
I am currently trying to run this script
/opt/alt/php72/usr/bin/php -d memory_limit=-1 -d max_execution_time=0 /home/sboxgquk/public_html/forums/applications/core/interface/task/task.php fbe57fcf6e8f449336839593cc9f5297
every minute in the Cron jobs section of cPanel. However the lowest amount of time between each job is 5 minutes. It will not let me go lower than 5 minutes.
A screenshot of my issue is here.
I have tried using ***** for each interval and */1 for the minutes section, and expected it to let me run the job at */1 however it gives me the error "You did not format the date and time settings correctly." next to the minutes section.
What am I doing wrong?
You can select run every minute from the common settings. You can see that I'm able to do this. Screeenshot attached.
after checking the picture you provided, you are setting the wrong path of the cron use this path
/usr/bin/php -q /home/username/public_html/yourfilename.php
I want to make an app displaying LAST x days' temperature on 3 hourly basis using the openweathermap API only. I went through the available APIs. They either have the predicted forecast of next 5 days or the historical data expecting start and end as parameters which I tried to use then (https://openweathermap.org/history).
So just to check whether I have understood the params correctly or not, I tried fetching(through the address bar):
http://history.openweathermap.org/data/2.5/history/city?id=1275339&type=hour&appid=df78dcfa9580e72b15fdf62d406d34ec&start=1369728000&end=1369789200".
But I got HTTP error 401:
{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
I fail to understand how should the parameters be entered to get the desired results (last 5 days temperature on 3 hourly basis) and also how do I enter "cnt" (if needed to) such that it gives me 3 hourly data.
I have a table 'users'. In that table there is a field balance whose datatype is ENUM('Yes','No'). Now I want to create a trigger that is fired when the balance is set to "Yes". Also I want to reset the value of Balance to NO after 30 days.
I am using PHP Codeigniter. And I have a reseller table who has its own users. So Each reseller has some users.
So when a reseller sets the balance of user to yes the trigger should
be fired and after 30 days should set user balance to NO
Also the balance of each user should be Reset uniquely. I mean one uses's balance is set to yes today and user-two balance is set to Yes tomorrow . So how will trigger know when to fire for that each specific user?
My solution is
Maintain a column like updatedon.
Write a stored procedure to set balance to NO when updatedon is 30 days and balance is YES(according to your critaria)
Run a Job daily to invoke the stored procedure(It will set only 30 days back updated records)
In order to track date you need to keep a column on which user updated_to_yes_date. When ever user update that enum column to "Yes" you should set current date to updated_to_yes_date.
Now lets code the controller for cron job.
class Cronjob extends CI_Controller {
function index() {
// Get Date before 30 days.
$today = new DateTime();
$dateBefore30days = $today->modify('-30 days');
$this->db->update('users',array('enumcolumn'=>'No'), array('enumcolumn'=>'Yes', 'updated_to_yes_date'=>date_format($dateBefore30days , 'Y-m-d'));
}
}
I have not tested above controller but it will help you.
Now its time to set up cron job. You need to run this cron job every day. To know how to setup cron job on cPanel CLICK HERE
Now we need to execute controller method from command line. For that go to codeignitor Running via the CLI document.
In our case it will be like
$ php index.php cronjob index
In many case we need to provide full path to index.php like
$ php /path/to/webroot/index.php cronjob index