I`m trying to accomplish this:
When an exception is generated on a webapp, i want to log the exception to zabbix via it`s api.
Browsing the api and the internet, i didn't found anything that could be helpful.
I do not want to use zabbix_sender, i just want to make POST calls to the api.
You can't use zabbix API to submit monitoring data. You need to use the same protocol used by zabbix_sender. If I remember correctly it is json based only in the latest versions of zabbix sever but you'd better off with zabbix 2.0 as minimum anyway. The protocol is TCP socket based sending, I can't say anything about .net but there are numerous implementations. For me the most useful one was this one in python.
Not sure I understood the problem. I would split it into 2:
1. Intercepting exceptions
2. Sending using Zabbix
I cannot help with the 2, since I'm not familiar with the "Zabbix". But if you need to intercept either all or unhandled exceptions you can register to the following AppDomain events:
AppDomain.UnhandledException
AppDomain.FirstChanceException
You can perform the registration in your initialization code (e.g. Global.asax):
AppDomain.Current.UnhandledException += (s, args) => ... // Send using Zabbix
Related
I have gone through Jaeger Documentation. They have specified that how will Jaeger will work the HTTP request kind of scenario but if I want to get traces of Nservicebus's to publish/subscribe method then How will I get using Jaeger?
Is it possible? Or Jaeger only works with HTTP requests?
Not out of the box, you have to plug a behaviour into NSB that uses open telemetry
https://github.com/open-telemetry/opentelemetry-dotnet
You will have to write custom code.
Plus you can do push metrics as well as shown in our app insights, Prometheus and other samples.
Let's continue the conversation in our support channels?
Not sure if you are still looking for a solution for this. You should be able to do this currently using the NServiceBus.Extensions.Diagnostics.OpenTelemetry package from nuget. This is built by Jimmy Bogard and instruments NServiceBus with the required support for Open Telemetry.
The source for this is available here. You can connect this to any backend of your choice that supports Open Telemetry including but not limited to Jaeger and Zipkin.
Additionally, here is an example that shows this in action.
I want to implement a feature like, if anything has been updated on Server-side like in database(the change can be from a client or another resource), then an event should be triggered and i come to know what change has been made. Then, through a rest api, i will send the response to UI with an event code, message and the new data from database.
And on UI, i have the approach to handle the events.
Please, tell me the approach or study material to implement this feature.
To use bi-directional communication between the clients and server you can use one of the following frameworks depending on your requirments:
SignalR
WebAPI and WebSockets
Socket IO (framework for Node.js)
Alchemy-Websockets
Fleck
SocketCluster (framework for Node.js)
I'm using EF (6) with ASP.net MVC (c#). My hardware architecture:
main server - include windows service.
web-server - running my web-application UI.
The users request for some answer. My web-site adds the question to the Data-Base (SQL - server) with EF.
In my main server, the service detects the changes (new task arrived) and solve it.
The detection of new task made by busy waiting, which I do not like.
How it's being done:
My EF layer includes custom function, which fire every N minutes SQL stored procedure.
If the SP retrieve information, the service solve it.
What I want:
when new task added from the web-site, the web-site will send signal to the main server. When the signal arrives to the main server, it will immediately start to solve it.
How this can be done?
Thank you!
seems like a perfect use case for singalR....
please take a look at http://www.asp.net/signalr
signalR will choose the best suited communication method. it also uses sockets if available otherwise fallback to other means of transport.
You can create one more service for Comm. between two servers .
Solution implemented with WCF is very trivial to Develop ..
Whenever new Question is posted .. your webserver can invoke this webservice ..
bottom - line : Look into WCF
We do this a lot, I think you have a few options:
A shared storage mechanism which is polled from the receiver (what you are currently doing)
Using something like a webservice call to send a command to the receiver (Normally a synchronous processing technique)
Using a messaging framework such as NServicebus to send the command to the receiver (an asynchronous fault tolerant technique)
We use all of these techniques, but the one I normally find best is the last one.
Messaging introduces fault tolerance and asynchronous processing which are both very useful when building systems spanning multiple machines.
If this sounds like something that might help check out the pubsub example for NServiceBus here: http://support.nservicebus.com/customer/portal/articles/860297-how-pub-sub-works
Or if fault tolerance doesn't really matter to you I would recommend a selfhosted webapi running inside your windows service.
MSDN says
Silverlight version 4 enables support for the Windows Communication
Foundation (WCF) SOAP fault programming model, which allows the
service to communicate error conditions to the client. In previous
versions of Silverlight, if an error occurred on the service, it would
register as an HTTP 500 response code and details about the error
would not be accessible to the Silverlight client.
However a number of other locations suggest using this still for Silverlight 4 clients and the above seems fairly ambiguous on what to do for Silverlight 4. I was wondering if anyone could confirm what approach should be used for handling WCF errors on Silverlight 4.
Yes, if you want to catch faults in a Silverlight 4 client, you will need to use a custom WCF behavior that changes that HTTP status code from 500 to 200 when a fault is raised by the service.
See: http://msdn.microsoft.com/en-us/library/ee844556(v=vs.95).aspx
There are two HTTP stacks in Silverlight, one provided by the browser (the default one) and a client stack, which is one written using the native OS stack. If you use the first one, you need to use the fault behavior to convert from 500 to 200 in the service. But if you use the client stack, you should be able to consume "normal" faults in SL.
More information about this at http://blogs.msdn.com/b/carlosfigueira/archive/2009/08/15/fault-support-in-silverlight-3.aspx.
I have a server client application.
The clients sends the server http posts with info every second or so.
The server is implemented using C#, there server doesn't need to respond in any way to the client.
Whats the easiest and most practical way to get this done? Is there some kind of library that is easy to use that I can import into my project.
Why not just use a regular old web service? It sounds like you have simple functionality that doesn't need to maintain a connection state. With a web service, you can simply expose the methods to your client, accessible via HTTP/S. If you're already using .NET for your client, you can simply add a web reference to your project and have .NET do the heavy lifting for you. There wouldn't be any need to reinvent the wheel.
You can use http.sys to create your own http listener without IIS or additional overhead. Aaron Skonnard has a good article here.
Because of certain limitations of uhttpsharp (specifically no support for POST forms and file uploads and it using threads to process requests), I've made NHttp available at github which supports full request parsing like ASP.net and processes requests using the asynchronous TCP model.