简体   繁体   中英

How to monitor/interact with a Unix program from Windows?

I've written several custom-purpose Unix programs in C/C++ to parse inbound data files and insert records into a database. I would like to give the customer the ability to monitor the status of these programs from one or more Windows PCs. What's the best way, in this day and age, to communicate between the two?

Back in the day, I used to do this kind of thing by writing sets of dedicated client/server TCP/IP socket-level programs on both machines, using a home-grown protocol to request program status and generate responses. The Windows side would ping the Unix side every minute or so, and the Unix side would reply with various counts of records awaiting processing, records processed that day, MTD, and YTD (mostly simple file counts in a given directory but also database lookups). The Windows side could also tell the Unix side to restart, or to move a problematic record to a "hold" area... that sort of thing. Both sides included a dedicated "parent" process to make sure all the child processes continued to run, or would restart them if they died.

But that was back in the 80's and early 90's. Is there any newer, better, more reliable technology to do basically the same thing in this day and age? My speciality is in C/C++/C#, but I could implement something web based given a good tutorial. Also I'd like to stick to custom code or free/open-source solutions.

Is my hand-written TCP/IP client/server approach still the best thing for this situation?

Thanks for your time!

RabbitMQ (an implementation of AMQP ) would be a good and fairly easy-to-implement solution for your problem.

You could install the server on a platform of your choice and there are many client libraries, including Java and .NET , for posting messages with just a few lines of code.

What can RabbitMQ do for you? [Overview Excerpt]

Messaging enables software applications to connect and scale. Applications can connect to each other, as components of a larger application, or to user devices and data. Messaging is asynchronous, decoupling applications by separating sending and receiving data.

You may be thinking of data delivery, non-blocking operations or push notifications. Or you want to use publish / subscribe, asynchronous processing, or work queues. All these are patterns, and they form part of messaging.

RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM