Alert Manager Alert rules are not functioning properly [closed] - devops

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have a quick question on alert manager alerting rules, i have 500 IoT devices connected to the server and those are being monitored using prometheus, and i configured the alert rules in such a way to get an alert when ever a device goes offline. every thing is fine till now but, when multiple devices are going offline at different time, alert manager is sending alerts of all the players which are currently offline rather than showing the alert of particular player on particular time.
ALERT IoT_online
IF IoT_online == 0
LABELS {severity="critical"}
ANNOTATIONS {description="This device is offline {{ $value }}.", summary="Instance {{ $labels.instance }} IoT device is offline"}
I wanted to configure alerts in such a way that alert manager should only send alert of particular device alert on particular time rather than sending the alert of all offline devices every-time when a device goes offline. any one can help me ?
Thanks in advance

This is more an alertmanager question.
When an alert group sends a notification it will include every alert that is currently active, including ones that have been firing for a while.
You can split up the alert group into smaller groups by adding labels to the group_by however this increase the volume of notifications you receive, and risks spamming yourself.
You can also throttle how often alerts are sent due to group changes using the group_interval.

Related

How can you tell if two phones have come close to each other? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to implement a mobile phone app that raises a flag if two users come close to each other in the physical world.
I'm looking for a solution that does not require the apps to be actively open on the users phone to be able to make this determination and raise the flag.
Is this possible? Perhaps by bluetooth, or perhaps by using GPS & time data uploaded from each phone and have server determine if the users were sufficiently close together?
I'm looking for accuracy within <20ft.
I don't think you can do this without OS support. Apple's Core Location framework lets you set up an iPhone to listen for iBeacons and wake up the phone and launch your app in the background if it detects one, but you can't make an iPhone broadcast an iBeacon signal when the phone is locked and your app is suspended. Apple can, but you can't.
I believe the underlying BLE framework that iBeacons are based on have the same restrictions.
Apple has worked with public health officials to do what you describe to track COVID19 exposure. You install the app on your phone and it uses BLE to both broadcast an ID and listen for other users running the app, and records other app users that it sees. If somebody comes down with COVID, there is a way to send notifications to everybody who was in close proximity to the infected person.
EDIT:
It likely would be possible to do this using recorded GPS data and a server, but it would be a battery, network, and computing hog. (I guess it would not meet your requirements since the app would have to be active in the background and the GPS would have to be powered up at all times.) The GPS takes a lot of power, and unless you were running the GPS constantly you'd miss encounters at your desired < 20ft proximity. If you did collect constant GPS data you'd have to upload it all and then do a BUNCH of batch processing to find proximity hits. You'd want to do a first pass where you use a crude computation with a fairly large distance threshold to throw away data where no other devices were anywhere near, and then a second pass on a dramatically smaller data-set. EVEN with that approach it would mean a LOT of number-crunching.

Interprocess communication in iOS [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
We are developing an SDK for iOS which requires different apps on the same device to know each other and pass information between them.. This is required for battery consumption and network usage purposes.
Using custom UIPasteboard is not an option because the SDK will be hosted by apps from different companies.
Using openURL is not an option because it forces the target app to become foreground.
Our current idea consists of sending UDP packets between the different apps (each app listening on a different port).
Our questions:
1) Is there a simpler option?
2) Do you think that such a solution is somehow not allowed by Appleā€™s terms & conditions?
Because of limitations of iOS most reliable solution in this case would be using backend.
But if you still want to try - there is one option. You can use tools like GCDWebServer (https://github.com/swisspol/GCDWebServer and you can find more options) to set up local server on the device. Then you can use it to share resources. The problem here - is that you will not be able to run it in background all the time. You can investigate how you can make your app to run in background (using location updates or silent notifications) to check if this can satisfy your needs. Maybe your solution can be: combining backend server + local server + background app refresh

Geofencing iBeacons and how to find user location [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to make an application, that will tell me about user location, for example i need to know when user entered the office and when he exit.
I tried geofencing with regions, but in my case it is not reliable, i dont have much experience with beacons this is why i dont know how reliable are they, also i would't place a gps locator on the user. I only want to know when he is in on his working place.
FYI not related to controlling people, only to check availability.
I would like to ask you for if there is better or an alternative solution on how to do this.
P.S: iOS app
P.P.S: i would like to know more about this, not a ready to go solution (thought it will also be nice :D)
I've been working a bit with iBeacons (it was a year ago though) and their reliability depends on the brand. An iBeacon has an UUID which you need to add to your app in order for you to listen to the correct iBeacon. Furthermore the iBeacon sends its signal using bluetooth so you need to have bluetooth running on the device with the app doing the listening.
Basically if you want to know when a user enters a room you'll need to set up an iBeacon in the room which sends a signal that the user entering the room catches using your app, and where your app in turn sends some kind of callback to a backend (or however you want to send the information).
You wrote that you want to know when a user enters/leaves his/hers workspace, and to do this with iBeacons the user either needs a unique iBeacon which sends a signal to your app, or the user needs to have your app which catches a signal from an iBeacon placed in the workspace. Furthermore the reliability in the precision of iBeacons are very bad, if there is a wall between the iBeacon and the app searching the signal the distance can easily give a faulty precision of 20m.
It doesn't sound like iBeacons are the way to go. You could of course place iBeacons around, for example, an office and have each user use your app. Your app in turn then listens on the different iBeacons and when it registers a beacon it sends data to a backend API telling that the user has entered the office.
Don't have a solution for you though, sorry :<
While the loaded term "spy" will certainly put off a lot of people, the basic idea here is a fairly common beacon use case. Tracking user location is perfectly fine provided that the user opts-in and knows what is going on.
The basic implementation is simple. Put one beacon with a location-specific identifier near each entrance. The app will monitor for detections of this beacon, and each time it is detected the app can record an event of that indicates the user entered or exited the workspace.
The main reliability problem with this approach is that the app cannot know whether each detection was an entry or an exit. A user could walk to the entrance then immediately leave. If the user did this twice separated by four hours, it would look identical to the system as a user arriving then leaving four hours later.
Solving the above problem means placing beacons throughout the building to provide near full coverage. This may not be practical.
Even with the above limitation, the technique can provide good enough data for some use cases.

How to log network performance data in iOS applications? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Apple's SDK agreement limits an applications' scope of data access, but has anyone found how to log any of the following information (even if it has been shut down by apple)?:
Operating System,
OS Version,
Network Name,
Technology,
Device,
Latitude,
Longitude,
Time,
RSSI,
RSRP,
RSRQ,
RSSNR,
Cell ID,
Ping Time,
Packet Loss,
Ping Success Rate,
Download Speed,
Upload Speed,
Call Event Type,
This can be accomplished fairly easily on Android, but I'm trying to find a way to collect this data on iOS where there are more roadblocks in the way. All feedback is greatly appreciated.
Even if you have been rejected by Apple but you've found how to get this info, how'd you do it? Ultimately I'd like to create an app that can log this data in a passive way (doesn't need to be open), but active logging would work too.
For Latitude, Longitude, I think you can get using locationManager from Core Location. This provided that the user of the app allows you to get the location.
To know the network status, you may try Reachability sample code by Apple
https://developer.apple.com/Library/ios/samplecode/Reachability/Introduction/Intro.html
I don't think you can get as much information from iOS compare with Android as Apple really cares about the Privacy of it users.

iOS: creating a Server in Objective-C for iOS App [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
experts and friends. I have a question regarding creating a server for iPhone app. I have had experiences with HTML, server-side stuffs such as using PHP, mySQL etc.
But making an App utilizing a server is something I have not experienced with.
The ideas is as follows:
1.) A simple server that sends out responses in JSON format (I have only had experiences with parsing in Objective-C but not generating from within a server).
2.) Enabling users to create a very simple account (profile name, password, a 50 x 50 px profile picture)
3.) It is just a fun / learning project between me and my other coworker. We were hoping to do, let's say, if I am driving to work and so does he, on the same route, we were hoping to be able to see each other's locations on google map and send each other /receive message each other a short message via the server.
And we were hoping to do all this server stuffs (preferably) within xCode and in Objective-C. There are many resources for server-side stuffs on the web for Java, Python, PHP etc, but not Objective-C. And we would love to be able to do all these in Objective-C.
I was hoping to get some advice regarding the technologies needed (ex: from hardware to software requirements to the structure / architecture of the set up)
from all of you. Sample code and description would also be helpful.
Note: we are knowledgeable on how server works (sending / receiving requests, etc) and have coded already in Objective-C.
Thanks in advance.
if I am driving to work and so does he, on the same route, we were hoping to be able to see each other's locations on google map and send each other /receive message each other a short message via the server.
Your IP address will likely often change, so if you want your server to be always available, it will have to periodically update some database in a fixed location (e.g. dynamic DNS resolver).
However, note that Apple makes it possible for your app to stay in the background and receive location updates, but does not allow you to accept incoming network connections in the background.
The correct way to send a message to a constantly moving iOS device is through Apple's push services, as in this case Apple takes care of maintaining connection with the device.
So the best way to implement your app is still to go with classic client-server architecture:
server in a fixed location
if you want to send a message to the device, server sends a push notification through Apple's server
your app registers to receive push notifications so it's able to display them anywhere.
As for location, depending on whether you want your friend to be able to see you at all times, or only with your permission, you can either
register your app to wake up when location changes significantly to notify server about its location OR
implement a push notification my friend wants to see your location! and give the user the ability to send or decline sending the location.
If you're not sure about implementing servers and push services, Apple makes it relatively easy, as you can buy $500 Mac mini and install $20 OS X Server to get some pre-implemented functionality.

Resources