monit-general
[Top][All Lists]
Advanced

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

Re: Reload configuration


From: sven falempin
Subject: Re: Reload configuration
Date: Fri, 10 May 2013 12:47:47 -0400





On Fri, May 10, 2013 at 12:06 PM, sven falempin <address@hidden> wrote:
Through web interface it is possible to stop,
force a test for monit, start/stop/enable or disable monitoring for a service.

Is it possible to reload configuration through the http socket ???


--
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail 
/\ 

diff -u -r ./monit-5.5/src/http/cervlet.c ./monit-5.5-patch/src/http/cervlet.c
--- ./monit-5.5/src/http/cervlet.c      Thu May 10 22:52:38 2012
+++ ./monit-5.5-patch/src/http/cervlet.c        Fri May 10 17:46:19 2013
@@ -530,6 +530,9 @@
                           "<td style='color:red;'><form method=POST action="" Monit http server? "
                           "<input type=hidden name='action' value='stop'><input type=submit value='Go'></form></td>");
                 StringBuffer_append(res->outputbuffer,
+                          "<td><form method=POST action="" Monit configuration <input type=hidden name='action' value='reload'>"
+                          "<input type=submit value='reload'></form></td>");
+                StringBuffer_append(res->outputbuffer,
                           "<td><form method=POST action="" validate now? <input type=hidden name='action' value='validate'>"
                           "<input type=submit value='Go'></form></td>");

@@ -713,6 +716,10 @@
                         send_error(res, SC_SERVICE_UNAVAILABLE,
                                    "The Monit http server is stopped");
                         stop_httpd();
+                        return;
+                } else if (IS(action, "reload")) {
+                        LogInfo("The Monit http server stopped on user request\n");
+                        kill_daemon(SIGHUP);
                         return;
                 }
         }

reply via email to

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