I am having trouble setting up a Zabbix trigger for a Windows server.
The goal is to use run netstat via the Zabbix item, and count the number of entries with 'TIME WAIT'.
However, I don't want the trigger to alert when it the past 3 runs have data (a value more than 0)
I have tried using 'count(#3)>0' and 'last(#3)>0' but it always seems to fire when the item update happens, not based on the last three polls.
Should I be using a different expression?
To check for the last 3 values being 0 (or negative, but probably not possible in your case), use max(#3)=0.
Related
I've a table in my database with record of an agent. The record looks like
Here, Site ID is a place where the Agent 1001 visits at logs himself in at TimeIn and then logs out of that site at TimeOut and raises some tickets and its corresponding amount. Now, If the site is not changed then I want to aggregate these records as shown in the table given below:
I am using MySQL database to do this. Using window functions I can find out consecutive matching Site ID and then mark it as some flag_variable (let's say 1) in a new column.
Now, for these rows where flag=1, I want to update current row TimeOut = next row Timeout. For three or more consecutive record of same Site ID this approach will not work, then we should need a recursive approach I guess.
My question is how can we do this update in the current table and remove redundant records in the table using MySQL syntax.
I have a Dash DataTable with row_selectable set to "multi". Therefore, the user can select multiple rows via a checkbox that will appear next to each row of the DataTable.
I also have a callback that has as input Input("datatable-id", "selected_rows"). Therefore, each time the user selects a row, I get ALL the rows that are selected.
What I want to do is to update my database column is_selected based on the row that the user just selected. To get the row that the user just selected I can either:
Read my entire is_selected column of my database and find the difference between that and selected_rows.
Use selected_rows to update ALL the rows in my database.
I wonder, is there another better way to find out which specific row the user selected? So that I can simply update my single row in my database accordingly?
So, you can use a dcc.Store as a way to get access to the previous state.
If I'm not wrong, your problem is a comparison between two states: the state_0, the one before the interaction; and the state_1, the one after the interaction.
In that case, using only DashTable attributes, it is hard (at least I don't know how) to get the previous state of selected rows. With that in mind you can create a dcc.Store to store the last state of selected_rows to get access every time the callback is triggered. In other words, put the data as the Output off the callback and a State to get the access to state_0. Update the data with the current selected_rows after making a simple set difference between the current selected_rows and the previous one.
I am trying to do some automatic function on MySql.
I need that all arrows of a column named vipdays decrease by 1 on a daily basis.
I mean.. today the values of all arrows of the column vipdays = 30
Tomorrow all values = 29.. next day 28... and I need that this function
be automatic, that works without manually removing 1 day.
I have made some research and found some MySql Scheduler that automate
some functions but can't make it to work.
Any Ideas?
You should create EVENT that is executed once a day and enable scheduler (it is disabled by default).
It should work.
However, do you really want to do this?
You can store expire date in database instead of the number (ex: "DATE_ADD(CURDATE(), INVERVAL 30 DAYS)") and then compare it with CURDATE() to check if it is expired.
I am using c# winforms-MySql Server.
I have 12 values and in every hour I need to select one value from that 12 value list. Timer can easily select the number.
But the problem is I have 5 Terminal where the software is to be installed.
They all will select a value from the list. The value can be same or different.
But I need the select same value for all the terminal. I don't have any client-server facility because any terminal can be open or closed at any time.
Can MySql select a value from a list in every hour without any c# code?
Any concept will be helpful. I don't need any code if you have a problem.
Thanks
A solution can be:
Create a Table with only 1 Column and 1 Row. It will contain, in the single cell, the current synchronized value;
Create a Timer in mySql. You can get some useful infos here;
The Timer makes a Stored Procedure to run;
That Stored Procedure updates the synchronized value;
All the Terminals query the database looking for that value, whenever and however you want: they will always retrieve the a synchronized value.
My company keeps records of job codes & purchase order numbers as machines are used, etc. I am trying to create a form where an individual can populate a job number and then input the time a machine was used (machine name and hours) for that job along with a few other fields. My primary question is if there is a way to populate one job code for multiple machines/hours. This would eventually be used for employee time keeping also.
You can do this by creating an update query.
See Create and run an update query or Update Queries in Microsoft Access
Not sure much of a newbie you are, but here's what I would do from start to finish.
1) Create an update query by going to Create -> Query Design.
2) Add your table to the query
3) In the upper-left part of the screen, "select" will be selected. Click on "update" to create an update query
4) In your query criteria, add whatever criteria you need to make it apply to multiple machines or hours. For example machines that have worked between January 1, 2017 and June 1, 2017 you would add (you need #'s for dates in queries)
=#1/1/2017# And <=#6/1/2017#
to your date field. Or let's say you have three machines named A1, B2, and C3. You only want to apply to job code to A1 and B2. Under the field that denotes your machine name your criteria would be:
"A1" or "B2"
Whether you use the date or machine field, you'll need to use the update query to input the job code for all applicable cases. let's say you want to make the job code "Code124" for all people who meet the criteria you specified. Under the Update to line in your query, type in "Code124" and hit "Run" (the icon in the upper left corner with an explanation point. That should do it.