tj / mon

mon(1) - Simple single-process process monitoring program written in C
1.08k stars 94 forks source link

TCP or unix socket interface for integration with 3rd-party tools #14

Open kaero opened 12 years ago

kaero commented 12 years ago

May be my request poisons KISS principles, but it can be a great feature for integration with other tools without a need to parse text output from STDOUT.

tj commented 12 years ago

anything specific in mind? the "hook" commands could do whatever you want already

kaero commented 12 years ago

Under the "hook" you mean the --on-error and --on-restart options?

I near about creation a tiny web interface for a bunch of mon processes, but retrieving info about all mon instances, their options and current status looks a bit tricky and implicit without mon master-process or another common end-point for retrieving info about all running mon instances.

tj commented 12 years ago

ah I see, yeah maybe someday we can write mongroup in C and add some json networking stuff but that would be pretty annoying in shell scripts right now. you could still write a web thing but mon would have to become an internal implementation detail pretty much like mongroup, you dont even consider mon in that tool it's just there

kaero commented 12 years ago

ok, thanks for the answer. I think it's a time for monit.

tj commented 12 years ago

I do like dashboards etc, so I'd be happy to add something, I'll think on it. Even if the stdio was a more machine-friendly format, or a json option that would be much better

kaero commented 12 years ago

Mm… maybe an option in addition to -S to select output format: human-readable or some machine-friendly?

tj commented 12 years ago

yeah I think that would be good, nothing wrong with using stdio, it's easy enough to tail a file or pipe. I'll reopen

kaero commented 12 years ago

Yeah, thanks!

emberian commented 11 years ago

You can use socat to redirect to any sort of socket you want. eg, mon foo | socat TCP4:host:port - or mon foo | socat UNIX-CONNECT:/path/to/socket -. It's a great tool.

tj commented 11 years ago

was just thinking about this a bit, we're definitely better off going with a fifo or unix socket, less chance of people polluting stdio