<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Monitoring application&#x2F;daemon in a remote linux machine]]></title><description><![CDATA[<p dir="auto">Ciao,<br />
my problem is this:<br />
I would monitor an application/daemon in a remote linux machine: i would launch the commands start, stop, eccc. in the remote machine</p>
<p dir="auto">for example  if i want to restart snmpd daemon then i must to execute<br />
"/etc/init.d/snmpd start" in the remote machine</p>
<p dir="auto">What could be the ways to achieve this?</p>
<p dir="auto">Ciao to everyone!</p>
]]></description><link>https://forum.mango-os.com/topic/286/monitoring-application-daemon-in-a-remote-linux-machine</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 02:34:32 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/286.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Feb 2010 14:36:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Thu, 22 Apr 2010 15:34:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello everyone,<br />
after some testing and considering that I'm new with java<br />
to solve my problem I have proceeded as follows:</p>
<p dir="auto">MANGO-&gt;proxy-&gt;agent</p>
<p dir="auto"><strong>a)</strong> I created a html control with a button that makes a local call to a proxy java (proxyProcess) by ajax</p>
<pre><code>
&lt;script language="javascript"&gt;
&lt;!--
   var myRequest = null;
   
   function CreateXmlHttpReq( handler)
                {
                          alert("create XmllHttpReq");
                          var xmlhttp = null;
                          xmlhttp = new XMLHttpRequest();
                          xmlhttp.onreadystatechange = handler;
                          return xmlhttp;
                }
   function myHandler()
                {
                        
                        if (myRequest.readyState == 4 &amp;&amp; myRequest.status == 200)
                        {
                                alert(myRequest.responseText);
                        }
                }

   function sendRequest( operation)
                {
                        var path = '?process=snmpd&amp;command=' + operation;
                        var urlProxy  = 'http://xxx.xxx.xxx.xxx:8080/proxyPROCESS' + path;

                        alert("sendRequest to proxy \n" + urlProxy);

            try
            {
                    myRequest = CreateXmlHttpReq(myHandler);

                        myRequest.open( 'GET', urlProxy, true);
                        myRequest.send( null);
            }
            catch(e)
            {
                  alert(e.message);
            }

                }
--&gt;
&lt;/script&gt;
&lt;input type="button" value="start " onclick="sendRequest('start')" /&gt;

</code></pre>
<p dir="auto">b) I created a servlet (positioned between the servlet Mango) proxyProcess.class that received the request makes a remote call (<a href="http://yyy.yyy.yyy.yyy/provaXMango/PROCESSI/processCommands.php?process" rel="nofollow ugc">http://yyy.yyy.yyy.yyy/provaXMango/PROCESSI/processCommands.php?process</a> = "+ param1 + "&amp; command =" + param2) to the server where I want to execute the command</p>
<pre><code>
public class proxyPROCESS extends HttpServlet 
{
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		try
		{
			
			String param1 = request.getParameter("process");
			String param2 = request.getParameter("command");
			URL url = new URL("http://yyy.yyy.yyy.yyy/provaXMango/PROCESSI/processCommands.php?process=" + param1 + "&amp;command=" + param2);
			HttpURLConnection conn = (HttpURLConnection)url.openConnection();
			
			int code = conn.getResponseCode();
			
			//conn.disconnect();
		} 
		catch(MalformedURLException ex) 
		{
			ex.printStackTrace();
		} 
		catch(IOException ioex) 
		{
			ioex.printStackTrace();
		}

		
	}

}

</code></pre>
<p dir="auto">c) I created an php agent on the remote server to run command</p>
<pre><code>
&lt;?php
	 
	$availableProcess = array();
	getProcess( $availableProcess);
	
	$qs = $_SERVER['QUERY_STRING'];
	$process = $_GET['process'];
	$command = $_GET['command'];
	
	
	//comando to execute
	$completeCommand = "sudo /etc/init.d/" . $process . " " . $command;
	$tmp = exec( $completeCommand, $outputs, $ret_var);	
?&gt;

</code></pre>
<p dir="auto">To execute commands with www user with sudo, you need to enable the www user to run the desired command in sudoers, for example</p>
<pre><code>
apache  yyy.yyy.yyy.yyy=NOPASSWD: /etc/init.d/snmpd

</code></pre>
<p dir="auto">Everything works correctly!</p>
<p dir="auto">Probably this is not the optimal solution, but it works!</p>
<p dir="auto">Ciao</p>
]]></description><link>https://forum.mango-os.com/post/3645</link><guid isPermaLink="true">https://forum.mango-os.com/post/3645</guid><dc:creator><![CDATA[peppemath]]></dc:creator><pubDate>Thu, 22 Apr 2010 15:34:10 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 22 Feb 2010 15:49:00 GMT]]></title><description><![CDATA[<p dir="auto">Will the alert details be available as a variables to commands to send alerts to external systems? Hope the next release will be soon?</p>
]]></description><link>https://forum.mango-os.com/post/3271</link><guid isPermaLink="true">https://forum.mango-os.com/post/3271</guid><dc:creator><![CDATA[narenblr]]></dc:creator><pubDate>Mon, 22 Feb 2010 15:49:00 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 22 Feb 2010 15:44:18 GMT]]></title><description><![CDATA[<p dir="auto">This is a great feature to send alerts to external systems.<br />
Hope the next release will be soon?</p>
]]></description><link>https://forum.mango-os.com/post/3270</link><guid isPermaLink="true">https://forum.mango-os.com/post/3270</guid><dc:creator><![CDATA[narenblr]]></dc:creator><pubDate>Mon, 22 Feb 2010 15:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Tue, 09 Feb 2010 21:29:16 GMT]]></title><description><![CDATA[<p dir="auto">Um, i was kind of expecting that you would review the available data sources to know the possibilities before implementing anything. As it is, you cannot have Mango fire off an arbitrary web request in the manner you are expecting.</p>
<p dir="auto">But this did give me an idea. It's not as straightforward for your needs as you might like, but i believe it will offer a lot of general power. I've added a new "process" event handler, which provides active and inactive "process command" values. "Commands" are basically shell commands. When the event is raised the active command will be executed, and vice versa.</p>
<p dir="auto">A command could be "java -X" (although this wouldn't really be very useful for much), or "wget ...", which would be good for your situation, as long as you're using *nix. This will be available in the next release.</p>
]]></description><link>https://forum.mango-os.com/post/3177</link><guid isPermaLink="true">https://forum.mango-os.com/post/3177</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Tue, 09 Feb 2010 21:29:16 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Tue, 09 Feb 2010 11:27:41 GMT]]></title><description><![CDATA[<p dir="auto">Ciao<br />
I have created a php script called "processSNMPD"; launching the url <a href="http://localhost/processSNMPD.php?oper=xxxx" rel="nofollow ugc">http://localhost/processSNMPD.php?oper=xxxx</a> (with xxx=start/stop) with a webbroser, i can start or stop the service.<br />
Now, How can i send a HTTP request to server? In the context help (of Http receiver) i found "HTTP sender publisher" but, where is it? how it work? There isn't in the list of data sources types<br />
Can you help me?</p>
<p dir="auto">Ciao</p>
]]></description><link>https://forum.mango-os.com/post/3172</link><guid isPermaLink="true">https://forum.mango-os.com/post/3172</guid><dc:creator><![CDATA[peppemath]]></dc:creator><pubDate>Tue, 09 Feb 2010 11:27:41 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 08 Feb 2010 16:06:23 GMT]]></title><description><![CDATA[<p dir="auto">Use one of the data sources. Something suitable to the agent that will execute the commands on the remote host. The details are up to you.</p>
]]></description><link>https://forum.mango-os.com/post/3156</link><guid isPermaLink="true">https://forum.mango-os.com/post/3156</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 08 Feb 2010 16:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 08 Feb 2010 16:04:13 GMT]]></title><description><![CDATA[<p dir="auto">How Mango should get commands to linux box?</p>
]]></description><link>https://forum.mango-os.com/post/3155</link><guid isPermaLink="true">https://forum.mango-os.com/post/3155</guid><dc:creator><![CDATA[peppemath]]></dc:creator><pubDate>Mon, 08 Feb 2010 16:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 08 Feb 2010 15:11:29 GMT]]></title><description><![CDATA[<p dir="auto">It sounds like you're trying to do Linux administration, for which Munin is specifically suited. Mango is more generic. Mango may be able to get commands to the linux box, but you'll need an agent there to receive the command and execute it.</p>
]]></description><link>https://forum.mango-os.com/post/3154</link><guid isPermaLink="true">https://forum.mango-os.com/post/3154</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 08 Feb 2010 15:11:29 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 08 Feb 2010 15:05:10 GMT]]></title><description><![CDATA[<p dir="auto">No, I don't know Munin<br />
but it is impossible with mango?? :(</p>
]]></description><link>https://forum.mango-os.com/post/3153</link><guid isPermaLink="true">https://forum.mango-os.com/post/3153</guid><dc:creator><![CDATA[peppemath]]></dc:creator><pubDate>Mon, 08 Feb 2010 15:05:10 GMT</pubDate></item><item><title><![CDATA[Reply to Monitoring application&#x2F;daemon in a remote linux machine on Mon, 08 Feb 2010 14:47:23 GMT]]></title><description><![CDATA[<p dir="auto">Have you considered Munin?</p>
]]></description><link>https://forum.mango-os.com/post/3152</link><guid isPermaLink="true">https://forum.mango-os.com/post/3152</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Mon, 08 Feb 2010 14:47:23 GMT</pubDate></item></channel></rss>