zabbix interface wrong utilization of receive/sent - interface

I'm struggling with my interface item measurements Send and Received Bits.
The item of network interface for measure the send and receive bits I have added preprocessing with Custom multiplier to 8 .
When I using the snmpwalk to get the current interface traffic, I got the value is:
IF-MIB::ifHCOutOctets.2 = Counter64: 11057731246261
But back to zabbix web monitoring system, it show only have for this interface sent, did anyone have these problem or findings can be fix it can provide?

My advice for you is to get inspired by the default zabbix templates and how things are set in them.
do not forget to set a correct unit for your item - these can make difference how the final value of the item is calculated:
https://www.zabbix.com/documentation/5.0/en/manual/config/items/item
as far as post-processing goes it seems to be set correcly in your case.
Your item may be incorrecly detected as unixtime and therefore you see date instead of bytes per second so I advise to put in bps in the Units field.

Related

Grafana - Alert based on a minimum of requests

I hope you can help me.
What I have is some metric data I am collecting. I want to send out an alert, when I reach a specific error-rate on these metrics.
To make clear, my data looks something like this:
Timestamp
value (the runtime of a query)
state (error, success)
api-endpoint called
I have a grafana-Board doing some calculations, drops out something linke this:
error-rate
api-endpoint
number of calls made to the api endpoint
Fine for now - as I can read out on my grafana, I am able to send some error-messages/warnings, if the error-rate is too high. Works like a charm. But now comes the point:
If the first two (e.g.) calls to a specific api fail, I will instantly receive an alarm send by my grafana. I do not wan't that!
Is it possible - and if: how? - to alert me ONLY if this specific request was executed at least 5 times? It is no problem if this is a generic alert like "hey, something is wrong!" - but I need to figure out if the request triggering the alarm with 50-100% error-Rate was at least executed a specific amount of time before alarming.
It has to be done based on tags/fields, I do not want to add a single query for all of my 35+ APIs (number growing).
Any Idea anybody?
Using Grafana 8.0
Using InfluxDb 1.8 (with Flux enabled)
Just to make clear, if everyone ever want's to do the same: FluxQL is king - you can use filter functionality in there and only base data on datasets where value count is greater than X.
Yes: FluxQL is damn hot. I love it since a few month.

Is there a way to force the output of a Stat panel in Grafana to only show values in days

I'm building a Grafana dashboard with some Stat panels that show average, minimum, and maximum time values (see below) for specific fields in my database. I'm storing the data in seconds and setting the value's units to seconds after which the panel displays the time in weeks, days, hours, etc. For the sake of consistency, I would like everything to be shown in days but I haven't been able to find a way to force units for the output value. If it's possible to do this, could someone please point me to some docs, or something that could show me which configurations to make in my panels?
So far, I've tried (without success):
Configure each panel to use units of days
The result of this was that everything showed up in years, etc.
Configure each panel to create a new field by performing a binary calculation where I converted from seconds to days and then I updated the units to be days
The result was that the values were not changed at all -> instead of showing X days, or whatever, it just showed the value in seconds without the units. I'm not sure what I messed up there, but it didn’t change anything.
I found this link that discusses setting a time range for queries
This didn’t end up being useful for what I was trying to do because it was actually geared towards changing the query to a specific date range rather than the output.
I looked through the transformations documentation, stat panel documentation, and a few other panel documentation pages in an effort to see if there was any information on how to do it but I was unable to find anything on forcing the output value to use a specific unit.
Edit:
So I kept messing around with the dashboard and got a solution that works - i.e. it's a "good-enough" solution (see below) - but, now, I'm curious if it's possible to show the units along with the value without it converting it to some other unit. Does anyone have any ideas about this?
One thing to note is that the data for this image is different than the data for the previous one so I'm expecting an inexact conversion to days.
You can use a custom unit. It is a bit tricky to enter the unit in the UI because of the automatic selection but if you enter i.e. "days" (without the quotes) in the Unit field ans instead of leving the field with tab or mouse click use the scrollbar of the combobox and select the last entry "Custom Unit: days".
Hope it helps. And for the record: I am using Garafana 7.1.4

Event sourcing, Eventually Consistent, CQRS

I am currently stuck in a problem and hope you can help me with some ideas or best practices here...
Let's say I have an application using Event Sourcing and CQRS. I have
A green pot containing a number
A red pot containing a number
A setting where I define, the number from which pot should be displayed in the UI.
A calculated result that contains the number to be displayed
The current state of my application is
Red pot: 10
Green pot 20
Setting: Red
Result: 10 (value from red pot)
I have a Calculation service that subscribes to Red Pot service, Green Pot service and Settings service. I have a View Updater service that additionally subscribes to the Calculation service and updates the read model on any changes.
Now the following events are dropping in:
Green Pot: 25
Setting: Green Pot
The View Updater service is a bit busy today and has some delay in updating the view model.
The Calculation service handles the Green Pot event. It fetches the setting from read model (which is still set to Red) and does nothing.
After that the Calculation service handles Settings event. It fetches the Green value (which is still 20) from read read model and sends a new event (Result: 20)
After that the View Updater handles both events and updates the read model.
In this case, my application is not consistent - not even eventually.
Do have any thoughts how to handle something like this? Thanks for any ideas :-)
First thought is that it isn't clear that you are sharing the common understanding of eventual consistency. Martin Kleppmann's talk emphasized three ideas
Eventual Delivery
Convergence
No data loss
Second thought is that you seem to have introduced a race condition into your Calculation service design. If RedPot, GreenPot, and Setting are separate aggregates/streams, then there really isn't any time binding between them. The arrival of events from those sources is inherently racy.
Udi Dahan wrote Race Conditions Don't Exist
A microsecond difference in timing shouldn’t make a difference to core business behaviors.
This is where convergence comes into play: you need to design your solutions so that they reach the same results even though the timing of messages is different. This often means that you need to include in your model some concept of a clock, or time, and some way of defining the interval in which some result is true.
As you've defined the problem, the Results produced by the calculation service are more about caching a snapshot than maintaining a history. So a different way to think about the problem you are having is to consider that the calculation service should not accept any arbitrary data from the read model, but rather one that aligns with the events that it is consuming.
Calculation service: "Hi, I can haz green pot as of event #40?"
Read model: "Sorry, no can haz, retry-after: 10 minutes"
Calculation service: "OK, I'll try again later."
The Calculation service should subscribe to and receive all events (GreenPotUpdated, RedPotUpdated and SettingsChanged).
It is not OK for the Calculation service to depend on an eventually consistent read-model. Instead it should maintain its own private state, ensuring that the events are received in the correct order.

PLC Data Logging System: Some basic questions

I am currently trying to work with PLC. I am using kepware data logger to collect the PLC log data. The output is like below:
Time Stamp Signal Signal O/P
20130407104040.2 Channel2.Device1.Group1-RBT1_Y_WORK_COMP_RST 1
20130407104043.1 Channel2.Device1.Group1-RBT2_Y_WORK_COMP_RST 0
........................
I have few questions:
1) What does that 'Channel', 'Device', 'Group', 'RBT1_Y_WORK_COMP_RST' means ? - What I have got from the PLC class presentation is that: RBT1 (which refers a robot) is a machine and 'Y_WORK_COMP_RST' is it's one signal and 1/0 is the signal state at particular timestamp (like 20130407104040.2). But, I could not get from log data file what is: 'Channel', 'Device1' and 'Group1' means ?
2) I learned from classes that 'PLC is a hard real time system'. However, from the log data file I am seeing that: the cycle time differs often. I mean some time it takes (say) 5 seconds, sometime 7 seconds. Why that ?
3) Does this log data taken by kepware is the actual machine output ? Or taken from the PLC program ?
NB: I am very new in this field and taken very few classes. So, may be my questions are stupid. Please help me by giving some basic not so technical answer.
1) Channel2.Device1.Group1... is the path where your KEPware data logger could find your RBT1. If you add another device with another technology you should get something like : Channel3.Device1.Group1....
This is totally internal to KEPware data logger and have nothing to do with your PLC. What interest you is the last part of the path : RBT1_Y_WORK_COMP_RST
2) Are your PLC and the PC running the KEPware data logger time synchronized ?
3) You are connected to a PLC so the KEPware data logger take data from it, then your PLC has to be setup to collect the output of your machine if you want to do so.
1) The channel is the type of communication, it may be several communication protocol, like modbus or devicenet or whatever kepware supports.
The device is the device Kepware communicate with
and the group is just some way to sort your items
items will refer to your plc address and let you name the item as you wish. This way you got an easy to read alias of your address.
2) Hard real time systems means the PLC must react to its input change within a certain amount of time (Ref: Wikipedia) Most of the time PLC are programmed in Ladder, Ladder is sequential and depending of the step the program takes it maybe longer or shorter. Also the timestamp comes from Kepware, not the PLC, so it depends on kepware scan time as well.
3)Kepware connects to the PLC and request PLC address with the output status.

GPS Specific questions for Service application

I am working on a simple application that I need to be run as a service and report gps position every 3 minutes. I already have a working example based on the tutorial, but still have the followin doubts.
The starting of the service GPS1.Start(5*60*1000, 0)
Says first parameter is time lapse, and 2nd parameter is distance difference, How is determined, based on prior position ?
If I want to do what I stated before and I am scheduling / starting service every 3 minutes, this means I will need to ask a GPS1.Start(0,0) to get latest fix? what would be the gain to use the parameters?
I trying in a NexusOne and the Time object comes with local time, I have to do this to make it UTC but this is a tweak to the code. Is this a standard or could It change based on Phone model ? hora=DateTime.Date(Location1.Time + 6*DateTime.TicksPerHour)
thanks
If you are only interested in a single fix each time then you should pass 0, 0. These values affect the frequency of subsequent events.
You can find the time zone with the code posted here: GetTimeZone