Any idea if we can monitor a particular process in NewRelic whether it's running or not running?
I see that once we get to the detail of the server, we can see each process's status but my exact requirement is to get notification if the process in the server is running or not.
Use Newrelic Infrastructure option
After you add it to your server:
enter Infrastructure menu
Goto settings -> Alerts and add alert:
select process running alert type and the process you want to monitor
choose Trigger an alert when no processes are running
add policy with your email to get notify
Related
I am using Solace VMR community edition version 8.1
Whenever I try to create a topic or queue on the VMR the warning message shows up.
I have tried following the guide on
http://docs.solace.com/Configuring-and-Managing-Routers/Configuring-Guaranteed-Msging.htm
but there is no command for allow-guaranteed-message-receive.
I have also tried to using SolAdmin to add the topic and error message says "unable to complete request because router is not active for Guaranteed Delivery"
This was working fine when I used version 8.0 on another machine. Is it due to the version update or something else?
You can view the state of the message-spool in SolAdmin by navigating to the 'Message Spool Configuration' view on the 'General' tab. The Operational Status of the message-spool must be AD-Active in order to use guaranteed messaging or to create a queue or topic endpoint.
If the operational status is showing as AD-Disabled, this means the message-spool has been administratively disabled. You can change this by selecting 'Manage Message Spool Status' from the drop down menu on the right and clicking the gear. There will be a pop up where you can enable the message spool.
If the operational status is showing AD-NotReady, you can scroll down to see the 'Last Failure Reason' which will give you more information about why the message-spool is not ready to become active.
By default when you initialize a new VMR in version 8.1, the message-spool will be AD-Active if the VMR was configured correctly.
In my iOS App, which depends on a server backend, I want to offer the user a periodic check, whether the backend is available after the app failed to connect to the backend.
In most cases this should not be necessary, but in case there is a server problem my iOS shopping app can not proceed and right now just displays a view with very little information, which is available offline, and a button to "Try again" until the server is (hopefully very soon) available.
Now I would like to provide a better UX and make the button a "Notify me, when the shop is back online"
The idea is to check the shop server in periodic intervals and once it is back online to send a local notification to the user.
Now I might register for a background task, to download data in the background and inform the user about "new content", which might even not require a local notification.
That would be a UIBackgroundMode with a value of "fetch". But I have doubts, if that's a good approach. In 99.9% of the cases it will never happen and I also only need that background task, IF the server is not available AND IF the user taps on "Notify me". The docs however look like, this background fetch will ALWAYS run in the background. And that is not what I want.
How do other apps go about this problem? That should be a common task, isn't it?
I'm trying to connect to our push server via MQTT-Client-Framework.
There is no complication for connecting to server and with a few line of code i can connect to server and subscribe to topic.
but I have a few question that I could not find any direct answer for them.
1) How can I keep my client running at background?
2) What happen after device restart? how can I automatically connect to server after device restart?
3)Suppose I got an error during connecting to server. Will this library trying to connect in a loop? how many times it try? or I need to manage this myself?
4) The same 3 scenario for subscribing to topic?
Based on my experience on MQTT-client framework following are the answers to your questions/queries. I hope it clarifies your concerns and helps you to move ahead.
1) How can I keep my client running at background?
You can not keep your MQTT client running in background, as Apple doesn't allow any application to keep running for long time in background. Though if you override its not guaranteed your application will keep running in background. You can read more about background execution support in apple documentation.
Also refer issue posted on github for given framework.
2) What happen after device restart? how can I automatically connect to server after device restart?
Each time your app begin execution you need to connect to your server using MQTT client framework there is no auto connect mechanism available in MQTT-client framework. I suggest to write init your connection in specific controller which executes immediately after your app launch except same as AppDelegate
3) Suppose I got an error during connecting to server. Will this library trying to connect in a loop? how many times it try? or I need to manage this myself?
If your MQTT-client fails to connect your server, you need to handle it yourself, library doesn't try to auto connect as mentioned in previous answer. I have written sample code as below. Use NSTimer for auto connect to server.
[self.mqttSession connectToHost:MQTT_HOST port:MQTT_PORT usingSSL:NO connectHandler:^(NSError *error)
{
if(error)
{
// Application fail to connect to server, write your code to auto connect here
}
}];
4) The same 3 scenario for subscribing to topic?
If your broker server has configuration to track your existing subscription for individual users/client then you don't need to subscribe each time.
Otherwise each time you need to subscribe to same topic on successful connection. Use following MQTTSessionDelegate method to subscribe.
- (void)connected:(MQTTSession *)session
Happy coding :)
1)Project->Capabilities->Background Modes. There has some options for allowing your app to run at background.
2)Generally speaking, MQTT will not be disconnected to the server if your app is allowed to run at background, but i think you would better check up the connection and maybe re-connect MQTT to your server when the app become active again.
AppDelegate-> - (void)applicationDidBecomeActive:(UIApplication *)application;
3)Unfortunately, yes, it will. And you have to manage yourself.
4)I can't help.
For your first question:
Details on how to run in the background on iOS can be found here. This link also lists the actions that Apple allows to run in the background, if your app does not meet those criteria then it is likely to get thrown out of the app store by Apple.
The list also shows which UIBackgroundModes to place in your Info.plist to flag that your app needs background access.
The other 3 I can't help with
We all know that Apple doesn't allow app service to run in the background, so MQTT will be disconnected in the background mode.
Now do one thing use better frameworks for MQTT like this in this framework you will get auto-reconnect and callbacks and many things.
So When you receive a call back that the MQTT is connected, immediately subscribe to all the topics that you have.
And if you want to get all missed messages then you need to change the MQTT configuration to like 'clean = false'.
I have an application that is run both manually and as a scheduled task (without user login). Now when closing the application (main form's OnCloseQuery event), I want to display a confirmation dialog if running with user login.
How can I check if my application is running as a scheduled task without user login (trigger "On computer start")?
Far and away the simplest way to achieve your goal is to configure the scheduled task to pass an argument to the process. The process can use the presence, or otherwise, of this argument to make its decision.
I have to add e-mail notifications to a client server application.
Notifications happen as the user do some particular action on the client UI.
If I had a middle tier or a service running at server I can imagine how to do it:
1) I simply create a DB tables with "pending notifications"
2) as a user does an action that generates a notification I add a record to the table
3) serverside I would continuously try to send those mails and removing them from the table once sending is succesful
Now I cannot do this now, I have a plan to add a service later on, but for now I must go the quick and dirty way.
So somehow what I was thinking to is to implement something like this:
1) as a notify-worth event occurs at client, the same client (my exe) tries to send the notification, upon failure it will log the notification in the "pending notifications" table (failure can be becuase lack of internet connection or any other problem)
2) I add a Timer that will work from any client machine to check for pending notifications. If there are any the client will try to send the e-mail (using a transaction: I will mark a field as "TryngToSendFromClientX" and in case of failure I will reset that field to NULL)
I think this approach would work, it has obvious limitations (if after failure no one logs into the system, no notification will be sent - same would be if service goes "down"). But can you comment on this approach and suggest a better one?
Additional notes (to better understand the scenario):
a) Note: all notifications are sent from the same e-mail account.
b) I don't need to keep track of who sent the e-mail.
c) the problem of creating the service now is that it will basically complicate significantly deployment and I need to create tools for monitoring the status of the service. Something that I will do in future but not now, in future I have plan to add more functionality (not only sending notifications) to the service, so in that case it makes more sense to create it.
d) I will send e-mails by using Indy components and SMTP server.
If you are not willing to create the service now, I think you are stuck with the scenario you describe. There are some things though you could do to circumvent the problem of no user firing up the client anymore while there are still pending messages.
You could add a commandline utility (or commandline parameter as bepe4711 suggested) that will only check for pending messages and try to send them.
Add this commandline utility to the StartUp folder or Run key in the registry. This way messages will at least get sent when the computer restarts, even if the user does not fire up the your app.
Add a scheduled task to run this utility at least once every day. The scheduled task can be added by code or by your installer.
If you do both, you will only have to worry about pending messages of users that never start their computer again.
Perhaps you can add a parameter to your client which causes it to just look at the pending notifications and send them. After this it can terminate itself. It will just act like some kind of service.
Then you install the client on the server and start it every x minutes.
I do something very similar to the approach you describe. Instead of sending emails I need to call a web service. My application is installed on several laptops and they are commonly not connected to any network.
When my application raises an exception I collect various bits of information including user comments and screen shots. Then I attempt to send this to our web service. If by chance the web service is not available. (i.e. not connected to the internet or web service is down) I write the results to an XML file on disk in the User Profile (App_Data) directory.
The one major difference is I don't poll to check to see if the server is up. I attempt to send them again on the startup of the application.
If both Systems are running on Windows, have a look at MS Message Queue. It is designed to send notifications to systems, which are not allways online. I did it in .Net, there are already easy to use classes implemented. Not sure about Delphi.
Latest version of Windows uses much more the Windows Task Scheduler, and now task can be fired on event (i.e. when a network card gets connected...). You could write a separate utility that tries to send pending notification, even if noone is logged in.