<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hello,</p>
<p><br>
</p>
<p>I'm having an issue here. I want to run an external script in Xymon. So i follow the docs. </p>
<p><br>
</p>
<p>I'm trying to run a test script that will for now just to an echo to a logfile. </p>
<p><br>
</p>
<p>Here is what I have done. </p>
<p><br>
</p>
<p>* In analysis.cfg  </p>
<p></p>
<div><span style="background-color: rgb(255, 255, 0);">HOST=qcdvap1096</span></div>
<div><span style="background-color: rgb(255, 255, 0);">        LOG /home/xymon/client4.3.17/logfile "testword"</span></div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div>* In client-local.cfg</div>
<div>
<div><span style="background-color: rgb(255, 255, 0);">[qcdvap1096]</span></div>
<div><span style="background-color: rgb(255, 255, 0);">log:/home/xymon/client4.3.17/logfile:2048</span></div>
<div><span style="background-color: rgb(255, 255, 0);">trigger error<br>
</span></div>
<div><span style="background-color: rgb(255, 255, 0);">#The logfile is on the client </span></div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div><span style="background-color: rgb(255, 255, 255);">* In alerts.cfg</span></div>
<div><span style="background-color: rgb(255, 255, 0);"><span style="font-size: 12pt;">HOST=qcdvap1096 SERVICE=msgs COLOR=red,purple</span><br>
</span></div>
<div>
<div><span style="background-color: rgb(255, 255, 0);">        #MAIL ampinder.singh@cgi.com COLOR=red REPEAT=2h</span></div>
<div><span style="background-color: rgb(255, 255, 0);">        #SCRIPT /home/xymon/server/scripts/connect.sh MAIL ampinder.singh@cgi.com COLOR=red</span></div>
<div><span style="background-color: rgb(255, 255, 0);">        SCRIPT /home/xymon/server/scripts/connect.sh MAIL ampinder.singh@cgi.com COLOR=red</span></div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div><span style="background-color: rgb(255, 255, 255);">I have created my test script on the server: </span></div>
<div><span style="background-color: rgb(255, 255, 0);">#Name of the script: connect.sh</span></div>
<div>
<div><span style="background-color: rgb(255, 255, 0);">#!/bin/bash</span></div>
<div><span style="background-color: rgb(255, 255, 0);">#This script on the server where Xymon is installed will call another script ont the client (qcdvap1096)</span></div>
<div></div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div style=""><span style="background-color: rgb(255, 255, 0);">ssh xymon@142.101.131.45 /home/xymon/client4.3.17/ext/test.sh</span></div>
<div style=""><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div style=""><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div style=""><span style="background-color: rgb(255, 255, 255);">This is my script on the client (qcdvap1096) that gets called</span></div>
<div style="">
<div><span style="background-color: rgb(255, 255, 0);">#!/bin/bash</span></div>
<div><span style="background-color: rgb(255, 255, 0);">#Name of the script: test.sh</span></div>
<div><span style="background-color: rgb(255, 255, 0);">#Working line</span></div>
<div><span style="background-color: rgb(255, 255, 0);">#echo "it's down again" >> /home/xymon/client4.3.17/loggenerated.txt</span></div>
<div style=""><span style="background-color: rgb(255, 255, 0);">echo "`date` "Server" "went" "out"" >> /home/xymon/client4.3.17/ampinder.txt</span></div>
<div style=""><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div style=""><span style="background-color: rgb(255, 255, 255);">So I manually add the word "testword" on logfile and it works my script gets called. But my only issue is that the script gets run twice. Like a second of eachother</span></div>
<div style=""><span style="background-color: rgb(255, 255, 255);"><br>
</span></div>
Here is the output of the log generated (/<span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px; background-color: rgb(255, 255, 0);">home/xymon/client4.3.17/loggenerated.tx)</span></div>
<div style="">
<div>Thu Dec 10 13:12:55 EST 2015 Server went out</div>
<div>Thu Dec 10 13:12:56 EST 2015 Server went out</div>
<br>
</div>
<div style="">I dont know why it runs twice. I only want it to run once. As soon, it's see the word "testword" it should run it once. </div>
<div style=""><br>
</div>
<div style="">Could you please help me resolve this issue?</div>
<div style="">Thanks</div>
<div style="">Ajay</div>
<br>
</div>
<div><span style="background-color: rgb(255, 255, 0);"><br>
</span></div>
<div><br>
</div>
<br>
</div>
<br>
</div>
<br>
<p></p>
</div>
</body>
</html>