[twsocket] Nagios like communication
Hi, I would like to implement a new feature into one of my applications where I can ask for a status through a (VPN)network connection, kind of like Nagios does. Or maybe even build functionality into it so that it can be queried by Nagios. Which methods/components should I go with? Florian -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> I would like to implement a new feature into one of my applications > where I can ask for a status > through a (VPN)network connection, kind of like Nagios does. Status of what? > Or maybe even build functionality into it so that it can be queried > by Nagios. Query what? Nagios is a Linux network monitoring tool, one of dozens, which I believe variously uses SNMP, HTTP. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
Angus, Sorry, I should have explained better the first time. My application collects data from industrial PLC's via OPC, it is running on quite a number of clients which I cannot constantly check manually. I already have functions to detect failure conditions like no connection to the PLC or lost connection to the database and such. If that happens and the program cannot recover by itself, I get an email so that I can take measures. The linchpin of all this is, that the program itself is up and running, doesn't hang and that it can still response. Otherwise, days can go by and no data is recorded. So my idea was to have a little watchdog (to be programmed) running on a server which regularly connects to all of the clients to get a response that all is well. The response could by for example the timestamp of the last data received from the PLC or similar. In case there is no response or the timestamp is too old, the watchdog notifies me by email. Florian >> I would like to implement a new feature into one of my applications >> where I can ask for a status >> through a (VPN)network connection, kind of like Nagios does. > > Status of what? > >> Or maybe even build functionality into it so that it can be queried >> by Nagios. > > Query what? > > Nagios is a Linux network monitoring tool, one of dozens, which I believe > variously uses SNMP, HTTP. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> The linchpin of all this is, that the program itself is up and > running, doesn't hang and that it can > still response. Otherwise, days can go by and no data is recorded. I hope your application is already a Windows service, you can then make use of the various service restart options if it stops. These options do not handle lock-ups, so you really need a second Windows service sending messages to the first, and using various methods to crash and restart it if there is no response, maybe also checking a shared file or registry key to make sure the first program is working. > So my idea was to have a little watchdog (to be programmed) running > on a server which regularly connects to all of the clients to get a > response that all is well. Several years ago I had a large project with PCs running on road vehicles, which is a horrible environment, power surges, heat and vibration. I had three 'vehicle activity servers' using TWSocketServer which the remote vehicles contacted via wifi (and later 3G) every five minutes, which updated a SQL database, reported on web pages. I designed a simple TCP/IP ASCII protocol that ended up with about 50 different commands each way, returning status information like fan speeds and CPU temperatures so we knew when the PCs were about to die (50% of CPU fans died within a year). Some of this you can do with off the shelf software, I sell an application ComCap that accepts UDP and TCP messages, and will email based on content or when they stop, and I use it myself so I know when my remote hosted servers goes off-line. Nagios is probably similar, but much more specialised than ComCap, but I've no idea what sort of input streams it expects. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
Florian Hector wrote: > I would like to implement a new feature into one of my applications where I > can ask for a status > through a (VPN)network connection, kind of like Nagios does. Or maybe even > build functionality into > it so that it can be queried by Nagios. > > Which methods/components should I go with? There are different options. You can use a basic TCP socket server in line mode with a custom protocol like Client> get database status Server> database status OK Client> get processing status Server> processing status ERROR which can be integrated into Nagios-compatible tools with the "check_tcp" plugin [1]. The "OverbyteIcsTcpSrv.dpr" ICS demo might be helpful as a starting point here. Another option would be to integrate a HTTP server component which returns application status as a HTML page. This allows you to make quick checks with a browser and you easily can add authentication e.g. by enabling HTTP digest auth. Integration into Nagios-like tools can be done with the "check_http" plugin [2]. The "OverbyteIcsWebServ.dpr" ICS demo might be helpful if you want to explore in that direction. BTW: I am using Icinga [3] for monitoring which is compatible to Nagios plugins. Regards, Tobias Links: [1] http://nagios-plugins.org/doc/man/check_tcp.html [2] http://nagios-plugins.org/doc/man/check_http.html [3] http://www.icinga.org/ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> > which can be integrated into Nagios-compatible tools with the "check_tcp" > plugin [1]. The "OverbyteIcsTcpSrv.dpr" ICS demo might be helpful as a > starting point here. > Tobias, which component can be used as client to talk to the above server component. Building an http server into my program sounds good but is way too much for what I need. Florian -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> which component can be used as client to talk to the above server > component. > Building an http server into my program sounds good but is way too > much for what I need. Look at free Magenta Systems IP Log Streaming Component at: http://www.magsys.co.uk/delphi/magics.asp which is a high level TCP/IP and UDP/IP, server and client, all in a single component, that can be dropped on a form and only needs a couple of events to send and receive lines of data. There is an EXE demo in the zip. It handles all the boring error handling, connection and disconnection events, retries on failure, etc, so you just program your own protocol. I've just finished a new version supporting SSL and IPv6, not on the web site yet. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> Look at free Magenta Systems IP Log Streaming Component at: > > http://www.magsys.co.uk/delphi/magics.asp > > which is a high level TCP/IP and UDP/IP, server and client, all in a single > component, that can be dropped on a form and only needs a couple of events to > send and receive lines of data. > > There is an EXE demo in the zip. It handles all the boring error handling, > connection and disconnection events, retries on failure, etc, so you just > program your own protocol. > > I've just finished a new version supporting SSL and IPv6, not on the web site > yet. Angus, I just fiddled a bit with one server instance and several client instances, it seems to be exactly what I need. So, if I want to make the conversation back and forth like asking for a status and waiting for a reply, I would need two instances of the component to handle both directions of the communication? Florian -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Nagios like communication
> So, if I want to make the conversation back and forth like asking > for a status and waiting for a > reply, I would need two instances of the component to handle both > directions of the communication? No, once a connection is made you have two-way communication, use the SendLogLine method to send a line and anything received arrives in the LogRecvEvent. But you can have as many instances of the component as you need, using different IP addresses and ports. Note this is really designed for line based protocols, it buffers a line at a time. I may add streaming in the future, but don't need it for any of my own applications, yet. Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be