monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

issuing commands via shell to daemonised instance ?


From: Daniel Maher
Subject: issuing commands via shell to daemonised instance ?
Date: Wed, 22 Sep 2010 10:45:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0pre Shredder/3.0.3pre

Hello,

The monit executable has many helpful commands that can be run from the command line (and, better yet, scripted), such as "start", "stop", "summary", and so forth. I'm curious if there is a way to extend it to instances of Monit that are running as a daemon ? The help for monit 5.1.1 clearly states that the various actions are for non-daemon mode only, and (of course) they don't work otherwise :

address@hidden ~]$ sudo monit -V
This is monit version 5.1.1
Copyright (C) 2000-2010 by Tildeslash Ltd. All Rights Reserved.
address@hidden ~]$ sudo grep daemon /etc/monit.conf
set daemon 120
address@hidden ~]$ ps axuw | grep monit | grep -v grep
root 13029 0.0 0.0 58516 2488 ? Sl Jul26 1:28 /usr/bin/monit
address@hidden ~]$ sudo monit status
monit: cannot read status from the monit daemon
address@hidden ~]$ sudo monit monitor ntpd
monit: error receiving data -- Resource temporarily unavailable

I used to get around this by using curl to issue http interactions, such as :

/usr/bin/curl -d "action=monitor" http://localhost:2812/ntpd";

This worked great until recently, when i activated http authentication to our LDAP back-end (to bring Monit in line with the rest of our infrastructure). I could pass a username and a password in the curl command, but i'd rather not leave authentication credentials lying around in plain text files.

Does anybody have any ideas how i might be able to script Monit interactions given the scenario ?

Thank you.


--
Daniel Maher <dma PLUS monit AT witbe DOT net>
"The Internet is completely over." -- Prince



reply via email to

[Prev in Thread] Current Thread [Next in Thread]