From MAILER-DAEMON Fri Apr 01 10:13:54 2016 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1alzpi-0005Bm-EH for mharc-monit-general@gnu.org; Fri, 01 Apr 2016 10:13:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alzpe-0005Ar-UK for monit-general@nongnu.org; Fri, 01 Apr 2016 10:13:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alzpb-0006xM-It for monit-general@nongnu.org; Fri, 01 Apr 2016 10:13:50 -0400 Received: from tildeslash.com ([62.109.39.247]:53195 helo=www.tildeslash.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alzpb-0006x7-7o for monit-general@nongnu.org; Fri, 01 Apr 2016 10:13:47 -0400 Received: by www.tildeslash.com (Postfix, from userid 1003) id 83FBD1D042F; Fri, 1 Apr 2016 16:13:44 +0200 (CEST) Received: from [192.168.1.10] (ip-89-176-19-139.net.upcbroadband.cz [89.176.19.139]) by www.tildeslash.com (Postfix) with ESMTPSA id 81EFC1D0376 for ; Fri, 1 Apr 2016 16:13:41 +0200 (CEST) From: Martin Pala Content-Type: multipart/alternative; boundary="Apple-Mail=_1DC70C18-1A16-45AD-9CBF-0AF27B5BF6E1" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Check a Process with a script Date: Fri, 1 Apr 2016 16:13:41 +0200 References: To: This is the general mailing list for monit In-Reply-To: X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 62.109.39.247 X-BeenThere: monit-general@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: This is the general mailing list for monit List-Id: This is the general mailing list for monit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2016 14:13:52 -0000 --Apple-Mail=_1DC70C18-1A16-45AD-9CBF-0AF27B5BF6E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, if you need a custom script, you can use the "check program": = https://mmonit.com/monit/documentation/monit.html#PROGRAM-STATUS-TESTING We have fixed the send/expect to provide more details about the failed = pattern = (https://bitbucket.org/tildeslash/monit/issues/335/display-output-on-faile= d-match-of-expect). You can run monit in debug mode (using -v option) or use = wireshark/tcpdump to trace the communication. Best regards, Martin > On 24 Mar 2016, at 14:55, Holder, Shane wrote: >=20 > Hello, > =20 > I am trying to check a process that sends arbitrary data on the = socket. The existing send/expect does not appear to be meeting my needs = as the output from the program I am attempting to check is not = consistent. > =20 > I am using the following monit script: > check process progname with pidfile = /var/run/progname.pid > start program =3D =E2=80=9C/etc/init.d/p= rog start=E2=80=9D with timeout 60 seconds > stop program =3D =E2=80=9C/etc/init.d/pr= og stop=E2=80=9D > if failed port send = =E2=80=9Ccommand\r\n=E2=80=9D expect =E2=80=9Ccommand ACK=E2=80=9D with = timeout 60 seconds retry 5 then restart > =20 > the program is a service which listens on a port and accepts commands. = It is possible that when connecting to the port that there is some = arbitrary data in the buffer which is sent on connection to the socket. = It is also possible that while connected data will be sent that is not = related. The following shell command succeeds where monit is not. > =20 > (echo =E2=80=9Ccommand=E2=80=9D; sleep 5) | nc localhost | grep = =E2=80=9Ccommand ACK=E2=80=9D > =20 > This allows me to ignore any arbitrary data coming from the port and = look only for my expected output. > =20 > I want to add something like. > If failed = status !=3D 0 then restart > =20 > Is something like this possible in monit 5.16 gramar? > =20 > =20 > Shane Holder=20 > AmerisourceBergen > Solutions Architect > Enterprise Architecture > =20 > 3101 Gaylord Parkway 2W-C120=20 > Frisco, TX 75034 > =20 > Work: 469.365.7727 > =20 > http://absg.com > =20 > =20 > CONFIDENTIALITY NOTICE. This electronic mail transmission may contain = privileged, confidential and/or protected health information and is = intended only for the review of the party to whom it is addressed. Any = unauthorized use or disclosure of the information contained herein may = be a violation of federal law, including the Health Insurance = Portability and Accountability Act (HIPAA). If you have received this = transmission in error, please immediately return it to the sender, = delete it and destroy it without reading it. Unintended transmission = shall not constitute the waiver of the attorney-client or any other = privilege. > -- > To unsubscribe: > https://lists.nongnu.org/mailman/listinfo/monit-general = --Apple-Mail=_1DC70C18-1A16-45AD-9CBF-0AF27B5BF6E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hello,

if you need a custom script, you can = use the "check program": https://mmonit.com/monit/documentation/monit.html#PROGRAM-STATU= S-TESTING

We= have fixed the send/expect to provide more details about the failed = pattern (https://bitbucket.org/tildeslash/monit/issues/335/display-outpu= t-on-failed-match-of-expect).

You can run monit in debug mode (using = -v option) or use wireshark/tcpdump to trace the = communication.

Best regards,
Martin


On 24 Mar 2016, at 14:55, = Holder, Shane <Shane.Holder@absg.com> wrote:

Hello,
 
I am = trying to check a process that sends arbitrary data on the socket.  = The existing send/expect does not appear to be meeting my needs as the = output from the program I am attempting to check is not consistent.
 
I am = using the following monit script:
          &nb= sp;     check process progname with pidfile = /var/run/progname.pid
          &nb= sp;            = ;         start program =3D = =E2=80=9C/etc/init.d/prog start=E2=80=9D with timeout 60 seconds
          &nb= sp;            = ;         stop program =3D = =E2=80=9C/etc/init.d/prog stop=E2=80=9D
          &nb= sp;            = ;         if failed port = <n> send =E2=80=9Ccommand\r\n=E2=80=9D expect =E2=80=9Ccommand = ACK=E2=80=9D with timeout 60 seconds retry 5 then restart
 
the = program is a service which listens on a port and accepts commands.  = It is possible that when connecting to the port that there is some = arbitrary data in the buffer which is sent on connection to the = socket.  It is also possible that while connected data will be sent = that is not related.  The following shell command succeeds where = monit is not.
 
(echo =E2=80=9Ccommand=E2=80=9D; sleep = 5) | nc localhost <port> | grep =E2=80=9Ccommand ACK=E2=80=9D
 
This = allows me to ignore any arbitrary data coming from the port and look = only for my expected output.
 
I want to add something like.
          &nb= sp;            = ;         If failed <run some = program here> status  !=3D 0 then restart
 
Is = something like this possible in monit 5.16 gramar?
          &nb= sp;            = ;         
 
Shane Holder 
AmerisourceBergen
Solutions Architect
Enterprise = Architecture
 
3101 Gaylord Parkway 2W-C120 
Frisco, TX 75034
 
Work: 469.365.7727
 
 
 

CONFIDENTIALITY NOTICE. This electronic mail = transmission may contain privileged, confidential and/or protected = health information and is intended only for the review of the party to = whom it is addressed.  Any unauthorized use or disclosure of the = information contained herein may be a violation of federal law, = including the Health Insurance Portability and Accountability Act = (HIPAA). If you have received this transmission in error, please = immediately return it to the sender, delete it  and destroy it = without reading it. Unintended transmission shall not constitute the = waiver of the attorney-client or any other privilege.

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

= --Apple-Mail=_1DC70C18-1A16-45AD-9CBF-0AF27B5BF6E1-- From MAILER-DAEMON Mon Apr 04 14:22:19 2016 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1an98k-0004O0-VG for mharc-monit-general@gnu.org; Mon, 04 Apr 2016 14:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an98f-0004NN-Cv for monit-general@nongnu.org; Mon, 04 Apr 2016 14:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an98b-00038f-BX for monit-general@nongnu.org; Mon, 04 Apr 2016 14:22:13 -0400 Received: from mail-yw0-x22c.google.com ([2607:f8b0:4002:c05::22c]:34034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an98b-00038T-1V for monit-general@nongnu.org; Mon, 04 Apr 2016 14:22:09 -0400 Received: by mail-yw0-x22c.google.com with SMTP id d68so125428260ywe.1 for ; Mon, 04 Apr 2016 11:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openbridge-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:message-id:in-reply-to:references:subject:mime-version; bh=/0oQ3V+rH1GC9uh/5ZfxOT6d5skOyU9T1HYtGWKZafI=; b=nTtr6pqP+fVPMLmsMScTURLBE3MqkWpP8THyw1eA1VSs4Lt3IKXJ4JwoGVU2QqkD7a 0bY3KWUnClyOhQ+hqEfcI2s8Acel4+DUJcSrvJfghJYeS1FALJ0PvC46BlO/Nim1sokk 6dOPfXk9O1f3kNmPE8/h0iCRCj8DnDAwA/xZyJL8ro01h9mYlATB1hC5rhhmrK+Pm4U1 8TidOhhAHoxeCbpaPWQeAPsYLHliUwWLipf+0nRlQD4vsa+Fb84yvExHuFfHYOtm14P+ 03N4NKsx1okBt2GgugjdWN+T3Zl8gD0dQv/en50fufiUOHfqgYULxdRm5g48plTcL2zj xmbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version; bh=/0oQ3V+rH1GC9uh/5ZfxOT6d5skOyU9T1HYtGWKZafI=; b=TJPliJa2HROlJtDG/cNK6FlZJ7wMQtuQ/L+C94eQCqC7wNs2LeueM/M/oBeoGup44o YFv0T9djgGkTS4EMG6sjsuLxTFVYx5g9UPJhHg7RFGoH3guSwrIXQMwoKtMjpO3KYW88 Geq4PqKfOXT7+QHANzjKfo7cPthE0o+AbOiBEIGrVIfsam4M6lMOnlLpXj8QdYtTZxkh zujicwZM+faJxZOdozBQrLRVELoqbswZtDzj08T/lHr959j5Yp618RUuAQKKcQp/1OBs JyducVTVOWkR5jUuppvXlaOGkf+oCSZakSyLdLQiXFuRsE8aKJQI7b/5iDVjwHVNBY6U Kccg== X-Gm-Message-State: AD7BkJIQV/OlcAVyVX/obghiohsa8IY/IcPvY2SEFXzYVDu/Td5PklGv5UokaoHYsrt6ow== X-Received: by 10.129.27.6 with SMTP id b6mr4922946ywb.205.1459794128169; Mon, 04 Apr 2016 11:22:08 -0700 (PDT) Received: from Thomass-MacBook-Pro.local (pool-173-48-129-78.bstnma.fios.verizon.net. [173.48.129.78]) by smtp.gmail.com with ESMTPSA id b126sm18159417ywd.3.2016.04.04.11.22.07 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Apr 2016 11:22:07 -0700 (PDT) Date: Mon, 4 Apr 2016 14:22:06 -0400 From: Thomas Spicer To: This is the general mailing list for monit Message-ID: In-Reply-To: References: Subject: Hacky Slack - Monit2Slack Webhook Client X-Mailer: Airmail (351) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5702b0ce_7251bab7_2b3b" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::22c X-BeenThere: monit-general@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: This is the general mailing list for monit List-Id: This is the general mailing list for monit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2016 18:22:17 -0000 --5702b0ce_7251bab7_2b3b Content-Type: multipart/alternative; boundary="5702b0ce_3a28fb6_2b3b" --5702b0ce_3a28fb6_2b3b Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46ellow Monit Users, Just released a Slack integration for Monit called =22Hacky Slack=22. Hac= ky Slack was created to provide better support for Monit within Slack, es= pecially where customizing the Slack UI for Monit events is desirable. By= making Monit events in Slack more visually compelling with color, layout= and icons, I found it provide users more context around the event. Hacky Slack uses Monit event variables for the Slack message. This means = it operates with minimal user input. This offers greater consistency for = Monit Slack messages across teams and systems.=C2=A0 A collection of Monit specific icons are also provided. These can be used= for different events for CPU, Memory or processing issues. Down the road= each Monit event can be mapped to its own visual treatment.=C2=A0 https://github.com/openbridge/ob=5Fhacky=5Fslack =46eedback and requests are welcome. Thanks, Tom --5702b0ce_3a28fb6_2b3b Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline