Re: ssl: unsafe legacy renegotiation

2023-02-09 Thread mart...@tildeslash.com


> On 9. 2. 2023, at 22:11, mart...@tildeslash.com wrote:
> 
> 
> 
>> On 9. 2. 2023, at 20:22, sashk via This is the general mailing list for 
>> monit  wrote:
>> 
>> Hi,
>> 
>>> Google the error and solution. Either update SSL on the cable modem 
>>> “server” if you can or modify Monit (the client) yourself. 
>> 
>> 
>> Upgrading ssl is not possible on cable modem, therefore as I stated in my 
>> original email:
>>>> It seems re-configuring OpenSSL it is possible to do systemwide, but I 
>>>> would like to avoid doing so.
>> 
>> I was hoping there is a way, similar to ssl options {version: TLSV1,... } to 
>> enable this setting just for this particular check in monit, not systemwide, 
>> as this opens system to CVE-2009-3555.
>> 
>> Thanks.
> 
> Yes, that is possible, see snip from Monit 5.27.0:
> 
> --8<--
> Version 5.27.0
> 
> Important: (Backward compatibility impact) The SSL "version: auto" now 
> defaults to TLSv1.2 and TLSv1.3 only.
> If you need to enable TLSv1.0 or TLSv1.1 (regardless of how insecure it is), 
> you have to explicitly enable it
> via the SSL option, example:   set ssl {
>version: tlsv11
> }  
> --8<--
> 

I'm sorry, i pointed only to the global option ... it is possible to override 
the SSL options for particular port test too, see the example from the manual.

The "version" ssl option in the port statement context works the same as on the 
global "set ssl" context:

check host example with address example.com
if failed
port 443
protocol https
with ssl options {selfsigned: allow}
then alert






Re: ssl: unsafe legacy renegotiation

2023-02-09 Thread mart...@tildeslash.com



> On 9. 2. 2023, at 20:22, sashk via This is the general mailing list for monit 
>  wrote:
> 
> Hi,
> 
>> Google the error and solution. Either update SSL on the cable modem “server” 
>> if you can or modify Monit (the client) yourself. 
> 
> 
> Upgrading ssl is not possible on cable modem, therefore as I stated in my 
> original email:
>>> It seems re-configuring OpenSSL it is possible to do systemwide, but I 
>>> would like to avoid doing so.
> 
> I was hoping there is a way, similar to ssl options {version: TLSV1,... } to 
> enable this setting just for this particular check in monit, not systemwide, 
> as this opens system to CVE-2009-3555.
> 
> Thanks.

Yes, that is possible, see snip from Monit 5.27.0:

--8<--
Version 5.27.0

 Important: (Backward compatibility impact) The SSL "version: auto" now 
defaults to TLSv1.2 and TLSv1.3 only.
If you need to enable TLSv1.0 or TLSv1.1 (regardless of how insecure it is), 
you have to explicitly enable it
via the SSL option, example:   set ssl {
version: tlsv11
 }  
--8<--


Cheers,
Martin


Re: link upload errors - ?

2022-05-26 Thread mart...@tildeslash.com
Hi,

it comes from the "tx_errors" statistics, see here for more details:
https://docs.kernel.org/networking/statistics.html

Best regards,
Martin


> On 25. 5. 2022, at 22:07, lejeczek via This is the general mailing list for 
> monit  wrote:
> 
> Hi guys.
> 
> I have something which I think I can say is peculiar & weird.
> I monitor a net link, wireguard interface to be specific, about which 'monit' 
> is not happy.
> I see:
> ...
> 'wg0' 8 upload errors detected
> 'wg0' trying to restart
> 'wg0' stop: '/usr/bin/systemctl stop wg-quick@wg0.service'
> 'wg0' start: '/usr/bin/systemctl start wg-quick@wg0.service'
> 'wg0' download errors check succeeded
> ...
> 
> What are the errors 'monit' reports?
> I watch the link and and link stays up, nothing seems wrong with it except 
> 'monit' sees it as "failed"
> In monit confg i have regular stuff I believe:
> 
> check network wg0 with interface wg0
>   start program = "/usr/bin/systemctl start wg-quick@wg0.service"
>   stop program  = "/usr/bin/systemctl stop wg-quick@wg0.service"
>   if failed link then alert
>   if 3 restarts within 20 cycles then unmonitor
> 
> What makes it weird - aside the fact that I cannot see link is down - is the 
> fact that this wg0 link connects to two hosts which are too watched by 
> 'monit', their wg0 ifaces naturally, and there on both those hosts monit is 
> happy, no action needed.
> 
> all suggestion on how to troubleshoot this are very welcomed.
> thanks, L.
> 




[Announce] Monit 5.28.1

2021-07-30 Thread mart...@tildeslash.com
Hi,

We have just released Monit 5.28.1

Download:   https://mmonit.com/monit/#download 



Release Notes:
==

Please see https://mmonit.com/monit/changes/ 
 for a complete and detailed list of changes 
in this release.


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team



Re: Monit is not notifying me of PID changes

2021-07-11 Thread mart...@tildeslash.com
Hello Viktor,

good catch, we've fixed the manual.

Best regards,
Martin


> On 11 Jul 2021, at 10:34, SZÉPE Viktor  wrote:
> 
> Idézem/Quoting mart...@tildeslash.com:
> 
>> Hello,
>> 
>> the PID and PPID change tests are no longer implicit from Monit 5.11.0, 
>> changelog excerpt:
>> 
>> --8<--
>> New: The PID and PPID change tests are no longer implicit. If you
>> want to test the process PID/PPID changes, you have to add this test
>> explicitly:
>>if changed pid then alert
>>if changed ppid then alert
>> --8<--
>> 
>> Best regards,
>> Martin
> 
> Good afternoon!
> 
> Manual says
> 
>> Monit can test the process's PID. This test is implicit ...
> 
> https://mmonit.com/monit/documentation/monit.html#PID-TEST
> 
> Could you please update it?
> Thank you.
> 
> All the best!
> 
> 
> SZÉPE Viktor, webes alkalmazás üzemeltetés / Running your application
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> ~~~
> ügyelet ️ hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 




Re: Multiple Email Recipients in ONE Mont Email

2021-06-30 Thread mart...@tildeslash.com
Hi Cyrus,

no, each message has isolated recipient in monit.

Btw. the following disclaimer shouldn't be used for public mailing list posts:
--8<--
The information contained in this message is proprietary and/or confidential. 
If you are not the intended recipient, please: (i) delete the message and all 
copies; (ii) do not disclose, distribute or use the message in any manner; and 
(iii) notify the sender immediately. In addition, please be aware that any 
message addressed to our domain is subject to archiving and review by persons 
other than the intended recipient. Thank you.
--8<--

Best regards,
Martin


> On 30 Jun 2021, at 21:56, Mehta, Cyrus  wrote:
> 
> I know I can send two separate emails using a config like:
> set alert ema...@example1.com  only on { timeout, 
> nonexist } with reminder on 10 cycles
> set alert ema...@example2.com  only on { timeout, 
> nonexist } with reminder on 10 cycles
> But is possible to send one email to both ema...@example1.com 
>  and ema...@example2.com 
>  , so a reply-to-all includes both email 
> addresses?  These 3 syntaxes didn't work:
> set alert ema...@example1.com;ema...@example2.com 
>  only on { timeout, nonexist 
> } with reminder on 10 cycles
> set alert ema...@example1.com,ema...@example2.com 
>  only on { timeout, nonexist 
> } with reminder on 10 cycles
> set alert ema...@example1.com  
> ema...@example2.com  only on { timeout, nonexist 
> } with reminder on 10 cycles
>  
>  
> TIA!
>  
> The information contained in this message is proprietary and/or confidential. 
> If you are not the intended recipient, please: (i) delete the message and all 
> copies; (ii) do not disclose, distribute or use the message in any manner; 
> and (iii) notify the sender immediately. In addition, please be aware that 
> any message addressed to our domain is subject to archiving and review by 
> persons other than the intended recipient. Thank you.



Re: The day I lost my job due to monit

2020-12-08 Thread mart...@tildeslash.com
We can extend the certificate verification to the whole chain.

Best regards,
Martin


> On 8 Dec 2020, at 19:11, rexkogit...@gmx.at wrote:
> 
> Sure, I admit I sought for a kind of a sensational headline. Monit is a
> great tool which surveils the services of this company since many years
> and alarmed us for many serious problems.
> 
> The more important line is the last sentence: There is room for
> improvement. Since I wasn't into C since more than a decade, I am sorry
> that I cannot really contribute to Monit, otherwise I would. I remember
> that it was roughly 400 lines of PHP code which made a reliable check of
> the TLS certificate chain and against the trust store in /etc/ssl/certs.
> What I want to give to the developers of Monit is this idea so they may
> improve this great tool even more.
> 
> Kind regards,
> 
> rex kogitans
> 
> Am 04.12.20 um 20:03 schrieb Paul Theodoropoulos:
>> You did not lose your job due to Monit, and you know that - you
>> clearly described what the proximate cause was of your losing your
>> job. It makes for a 'sensational' headline, but blaming it on Monit is
>> absurd.
>> 
>> On 12/4/2020 7:52 AM, rexkogit...@gmx.at wrote:
>>> I configured monit to monitor the TLS certificate validity of all of our
>>> highly productive websites. To all websites, the unnecessary full
>>> certificate (without root CA) was installed. However, on 30th of May
>>> 2020 one of the chain certificates (COMODO) ran out of its validity
>>> period. Obviously monit only checks for the server certificate, that's
>>> why the check did not notice this, and such a check is completely
>>> pointless. It led to a massive damage to my company, and since I was to
>>> deal with monitoring as well as TLS certificates, I had to move on to
>>> find a new job.
>>> 
>>> During the notice period, I implemented an own check in PHP and let
>>> monit execute this PHP program to check TLS certificates. This PHP
>>> program did not just check the entire chain, but also the chain against
>>> the system's own trust store (in /etc/ssl/certs). I think it would be an
>>> interesting feature to deal with TLS certificates like this in monit in
>>> order to avoid more people losing the jobs.
>>> 
>>> 
>> 
> 




Re: Monit shows "statistic error"

2020-11-18 Thread mart...@tildeslash.com
Hello Ani,

it may happen if the process exits while monit is collecting the data. No need 
to worry about it.

Best regards,
Martin


> On 18 Nov 2020, at 18:49, Ani A  wrote:
> 
> Sorry, small correction:
> 
> Monit version 5.25.1 on Ubuntu 18.04.4.
> 
> --
> Ani
> 
> On Wed, Nov 18, 2020 at 11:17 PM Ani A  wrote:
>> 
>> Hello,
>> 
>> I am running Monit 5.17.1 on Ubuntu 14.04, in some rare occasions
>> I see that following error in the log:
>> 
>> 2020-11-17 18:47:22.347 monit[2954]: system statistic error -- cannot
>> read /proc/3560/stat
>> 
>> And then, monit thinks that my daemon is not running and restarts it!
>> This restart triggers some unwanted other actions and I want to avoid it.
>> Can anyone please help why this can occur and how this can be prevented?
>> 
>> Thanks.
>> --
>> Ani
> 




[Announce] Monit 5.27.1

2020-10-24 Thread mart...@tildeslash.com
Hi,

We have just released Monit 5.27.1

Download:   https://mmonit.com/monit/#download 



Release Notes:
==

Please see https://mmonit.com/monit/changes/ 
 for a complete and detailed list of changes 
in this release.


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team



Re: Bug since upgrade and documentation

2020-07-21 Thread mart...@tildeslash.com
Hi,

the monit 5.27.0 enables just TLS 1.2 or later by default (even if the version 
is "auto"). It seems that the OpenSSL library on CentOS doesn't support it, you 
can enable e.g. TLS 1.1 explicitly this way:

 set ssl {
version: tlsv11
 }


Best regards,
Martin


> On 20 Jul 2020, at 16:33, Guillaume François  
> wrote:
> 
> To add some detail, we tried on another host OS (Ubuntu 20.04) while the 
> problematic one is CentOS , and it was working fine
> 
> Same binary but another OpenSSL stack probably.
> -
> This is Monit version 5.27.0
> Built with ssl, with ipv6, with compression, with pam and with large files
> Copyright (C) 2001-2020 Tildeslash Ltd. All Rights Reserved.
> -
> 
> --
> Remote Host '***'
>   status   OK
>   monitoring statusMonitored
>   monitoring mode  active
>   on rebootstart
>   port response time   114.394 ms to ***:443 type TCP/IP using 
> TLS (certificate valid for 104 days) protocol HTTP
>   data collected   Mon, 20 Jul 2020 16:30:06
> -
> 
> Best regards.
> 
> Le lun. 20 juil. 2020 à 16:26, Guillaume François 
>  a écrit :
> Hello,
> 
> Since we have upgraded from Monit 5.20.0 to 5.27.0 with have an issue with 
> certificate verification.
> 
> It seems broken as it cannot maanged to retrieve the certificate expiration 
> and it warn about a self signed certificate when it is not the case.
> 
> We are using the linux-x64 binary version from the website.
> 
> We have two rules:
> --
> if failed port 443 protocol https with ssl options {verify: enable} and 
> certificate valid > 10 days for 5 cycles then alert
> if failed port 443 protocol https request "/" with content ="xxx" for 5 
> cycles then alert
> ---
> 
> We tried to change the part "with ssl options {verify: enable}" to "with ssl 
> options {selfsigned: allow}" without any success.
> 
> Also regarding the documentation enhancement, we had to put the part "with 
> ssl options {selfsigned: allow}" after the part 'request "/" with content 
> ="xxx"' else Monit configuration syntax was failing. It would be good to 
> provide a sample in documentation.
> 
> In the global configuration file, the ssl setting was set to
> 
> set ssl {
>  verify : enable,
> }
> 
> We tried to add the new parameter "version" but it doesn't solved the issue.
> 
> set ssl {
>  version: auto,
>  verify : enable,
> }
> 
> Could anyone provide some guidance for this case ?
> 
> Best Regards.
> 
> 
> -- 
> -BEGIN GEEK CODE BLOCK-
> Version: 3.1
> GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? 
> w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI 
> !D- G(+)>+ e+++ h--() r->$ y?*
> --END GEEK CODE BLOCK--




Re: monitor service

2020-07-07 Thread mart...@tildeslash.com
Yes, something like this should work:

check process traccar match ""
start program = "/bin/systemctl start traccar"
stop program = "/bin/systemctl stop traccar"

You just need to replace the " by string that will match your process 
... you can test it with "monit procmatch "


Best regards,
Martin


> On 7 Jul 2020, at 08:31, Anders Yuran  wrote:
> 
> Hello!
> This is absolutely new for me so all possible help is needed.
> I have monit 5.25.1 installed on Ubuntu 18.04
> It monitor apache2 and mariadb but I also have a backend server installed for 
> gps tracking. Can I monitor that also?
> The traccar.service file looks like this
> 
> 
> [Unit]
> Description=traccar
> After=network.target
> 
> [Service]
> Type=simple
> WorkingDirectory=/opt/traccar
> ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml
> SyslogIdentifier=traccar
> SuccessExitStatus=143
> 
> [Install]
> WantedBy=multi-user.target
> 
> -- 
> Kind Regards
> 
> Anders Yuran
> 
> Havouza 15
> 4607 Pissouri
> Cyprus




Re: Check the age of a process

2019-08-22 Thread mart...@tildeslash.com
Yes, the uptime test can be used this way.

The process check will however alert if the process is not running - you can 
suppress this alert though: 
https://mmonit.com/monit/documentation/monit.html#Setting-an-event-filter 



Cheers,
Martin



> On 22 Aug 2019, at 19:28, David Jones via This is the general mailing list 
> for monit  wrote:
> 
> What if I wanted to check for something running too long?  I tried this and 
> it's alerting for not being present or for having less uptime.  Is it 
> possible to negate the alerting logic so it's OK when something is not 
> running or it's less that a certain age?
> 
> check process filter_grep_age matching filter_grep
> if uptime > 7 hours then alert
> 
> This filter_grep command shouldn't run for more than a few hours or a user 
> has forgotten to stop it.
> 
> From: monit-general  > on behalf of Lutz 
> Mader mailto:lutz.ma...@freenet.de>>
> Sent: Thursday, August 22, 2019 1:29 AM
> To: This is the general mailing list for monit  >
> Subject: Re: Check the age of a process
>  
> Hello Dave,
> a process uptime test ist available, see
> https://mmonit.com/monit/documentation/monit.html#UPTIME-TEST 
> 
> 
> The uptime test is availabel for the process and system service
> definitions only.
> 
> > Example of restarting the process every three days:
> >
> >  check process myapp with pidfile /var/run/myapp.pid
> > start program = "/etc/init.d/myapp start"
> > stop program = "/etc/init.d/myapp stop"
> > if uptime > 3 days then restart
> 
> With regards,
> Lutz
> 
> p.s.
> The test is available since some years (I find the test in Monit 5.16).
> Check the used Monit version with the command "monit -V".



[Announce] Monit 5.26.0

2019-07-06 Thread mart...@tildeslash.com
Hi,

We have just released Monit 5.26.0

Download:   https://mmonit.com/monit/#download


Release Notes:
==

Please see https://mmonit.com/monit/changes/ for a complete and detailed list 
of changes in this release.


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Monit doesn't understand ssl or https

2019-07-05 Thread mart...@tildeslash.com
Please can you check if monit was compiled with SSL? For example:

$ monit -V
This is Monit version 5.26.0
Built with ssl, with ipv6, with compression, with pam and with large files
Copyright (C) 2001-2019 Tildeslash Ltd. All Rights Reserved.

Best regards,
Martin


> On 5 Jul 2019, at 19:50, Roland Giesler  wrote:
> 
> I have monit installed on Ubuntu 18.04 (some nodes are reporting to M/Monit), 
> but a few test nodes are not yet and I'm trying to figure out how to monitor 
> https services.
> 
> Firstly I'm trying to set the ssl option in /etc/monit/monitrc with:
> 
>  set ssl options {
>  verify: disabled
>  }
> 
> However, when I start monit with 
> ~# service monit restart
> 
> I get this result:
> 
>  * Restarting daemon monitor monit
> /etc/monit/monitrc:133: Error: syntax error 'ssl'
> 
> If I comment out the ssl configuration, I get an error at the first https 
> reference.
> 
> The content:
> 
> check host FishEagle-Production with address 192.168.0.22
> if failed host 192.168.0.22 port 443 protocol https
> and request "/login"
> with timeout 25 seconds
> for 4 times within 5 cycles
> then alert
> #port 443 protocol https
> #if failed port 443 protocol https with ssl options {verify: disable} 
> then alert
> 
> The resulting error message:
> 
> ~# service monit restart
>  * Restarting daemon monitor monit
>   /etc/monit/monitrc:338: Error: syntax error 'https'
> 
> So what could the problem be?  How can I check the https services?
> 
> thanks
> 
> Roland 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Monit DNS check response

2019-06-04 Thread mart...@tildeslash.com
Hi,

the implementation of extended DNS protocol test with custom queries is in 
progress.

Best regards,
Martin


> On 4 Jun 2019, at 06:21, David Jones  wrote:
> 
> Does monit have the ability to check a DNS server for a specific response?  I 
> have a need to check a local DNS server and if it becomes unhealthy, shutdown 
> the bgpd service to send DNS traffic to a different data center.
> 
> Something like this?
> 
> check host nstest.example.com  with address 
> 127.0.0.1
> if failed port 53 
> use type udp protocol dns 
> content = "1.2.3.4"
> then exec "/bin/systemctl stop bgpd"
> else if succeeded then exec "/bin/systemctl start bgpd"
> 
> I already have an A record for "nstest" with a value of 1.2.3.4. 
> 
> Thanks,
> Dave
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Monit with Node Js

2019-06-04 Thread mart...@tildeslash.com
Hi,

monit doesn't support foreground processes - you need to modify the script to 
start the program in background.

Best regards,
Martin


> On 3 Jun 2019, at 07:56, Yogesh Jangra  wrote:
> 
> Hi all,
> 
>   I am trying to monitor a node js app using monit. The node server is 
> getting started using a script which starts the server as an foreground 
> process. but it results in specified error :-
> 
> failed to start (exit status -1) -- Program 'start_script.sh 
> 8881' timed out after 30 s
> 
>   1. Does monit `check process` expect an exit status as start_script 
> output ?
>   2. Does monit support monitoring the foreground run processes, if yes, 
> kindly give an example
> 
> Thanks
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Monit start delay only on boot

2019-06-03 Thread mart...@tildeslash.com
Hi Dave,

if monit depends on some services on your system, it'll be maybe better to set 
the dependencies and drop the start delay option from the configuration file.

Best regards,
Martin


> On 1 Jun 2019, at 21:31, David Jones  wrote:
> 
> Loving monit.  Just started using it a few months ago to deploy 
> Letsencrypt.org  certs from a central server to 
> about 800 servers/VMs.  Monit will restart/reload each service (Apache, 
> Postfix, Haproxy, Nginx, etc.) that references an LE cert when it's renewed 
> every 60 days.  This is working great.
> 
> I am remotely monitoring Monit using Icinga/Nagios and they are working very 
> well together.  I am moving many of my Icinga checks into Monit using scripts 
> to generate /etc/monit.d/*.cfg files custom for each server.  Then a single 
> Icinga/Nagios check using check_monit.py will be customized to each box.
> 
> The only minor issue is the delay start that is needed for bootup but causes 
> "connection refused" in the monit web interface used by check_monit.py when 
> monit restarts.
> 
> Would it be possible to have an option added to only delay XX seconds on a 
> fresh boot where the uptime is less than a few minutes?  Or allow the monit 
> web interface to immediately accept connections if a recent statefile exists?
> 
> Thanks,
> Dave

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

Re: Monit not restarting a service reliably

2019-06-03 Thread mart...@tildeslash.com
Hi,

since monit 5.16.0, the exec action is executed only on a state change. In your 
case the service didn't transition to the "succeeded" state, so the exec action 
wasn't repeated.

If you want to retry the exec action if the service remains in failure state, 
you can use the "repeat" option.

Snip from monit 5.16.0 changelog which provides more details:

--8<--
New: The exec action is now executed only once, on state change, same way as 
the alert
action. The new "repeat" option allows to repeat the exec action after given 
number of
cycles if the error persists.  Syntax:
if  then exec 

Re: Monit with Node Js as foreground

2019-06-03 Thread mart...@tildeslash.com
Hi,

monit currently doesn't support foreground processes monitoring.

Best regards,
Martin


> On 3 Jun 2019, at 08:45, Yogesh Jangra  wrote:
> 
> Hi all,
> 
>   I am trying to monitor a node js app using monit. The node server is 
> getting started using a script which starts the server as an foreground 
> process. but it results in specified error :-
> 
> failed to start (exit status -1) -- Program 'start_script.sh 
> 8881' timed out after 30 s
> 
>   1. Does monit `check process` expect an exit status as start_script 
> output ?
>   2. Does monit support monitoring the foreground run processes, if yes, 
> kindly give an example
> 
> Thanks
> 
> 


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


Re: Considerations when using Monit with systemd

2019-04-20 Thread mart...@tildeslash.com
Hi,

if you control the same services with systemd and the system is stopping, monit 
should be stopped first to prevent collision between monit and systemd.

Starting the system services on boot in parallel with systemd should work fine 
- systemd will just get a request from monit to start the service and even if 
the start is pending already, it's no problem.

Best regards,
Martin


> On 16 Apr 2019, at 14:01, Jamie Burchell  wrote:
> 
> Hi!
>  
> I’m successfully (and happily) using Monit to monitor services that have 
> suddenly exited on a CentOS 7 setup. For example:
>  
> check process mariadb with pidfile /var/lib/mysql/hostname.pid
>   start program = "/bin/systemctl start mariadb"
>   stop program = "/bin/systemctl stop mariadb"
>   restart program = "/bin/systemctl restart mariadb"
>   if failed port 3306 protocol mysql then restart
>   if 3 restarts within 5 cycles then unmonitor
>  
> Do I need to do anything else to make Monit and systemd play together nicely? 
> My concerns are:
>  
> 1. What happens when the system is shutting down, does Monit frantically try 
> to start things up that are shutting down, or has Monit itself been stopped 
> by that point?
>  
> 2. Is there are problem with Monit trying to start services at the same time 
> systemd does at system boot time?
>  
> I have read 
> https://mmonit.com/monit/documentation/monit.html#SYSTEM-REBOOT-AND-SERVICE-STARTUP
>  
> .
>  
> Thanks in advance!
> Jamie
>  
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Why does “failed protocol test [PGSQL]” happen when system is under load, or how to troubleshoot?

2019-04-09 Thread mart...@tildeslash.com
Hi,

the error is most probably caused by timeout ... you can catch and verify the 
communication between monit and postgresql for example using Wireshark. 

Best regards,
Martin


> On 9 Apr 2019, at 23:23, Support Team  wrote:
> 
> The error from Monit:
> 
> [EDT Apr 9 12:40:45] error : 'pgbouncer' failed protocol test [PGSQL] at 
> [127.0.0.1]:6432 [TCP/IP] -- PGSQL: error receiving data -- Resource 
> temporarily unavailable
> 
> This happened while the system was under higher-than-normal load (nginx was 
> handling about 330 requests/second vs. 90).
> 
> My question, what would cause this, how do I troubleshoot it, and what might 
> fix this?
> 
> Monit has done this before on this machine with other processes.
> 
> Here is the config:
> 
> check process pgbouncer with pidfile /var/run/postgresql/pgbouncer.pid
> start program = "/etc/init.d/pgbouncer start"
> stop  program = "/etc/init.d/pgbouncer stop"
> if failed host 127.0.0.1 port 6432 protocol pgsql then restart
> 
> Thank you!
> 
> I appreciate & respect your time. I am very keen to solve this, whatever is 
> necessary.
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: loadavg figures - percentages or not?

2019-04-08 Thread mart...@tildeslash.com
Hi,

the loadavg is not percent - as the manual states, it is absolute value: number 
of processes in the run queue. The practical limit depends on the number of 
CPUs and the typical load pattern - a rule of thumb we use is 2 processes per 
CPU core. If the machine has for example 48 cores, the loadavg of 96 is usually 
acceptable. There could be also spikes which are common and you may want to 
suppress false alerts, the example shows setup where high loadavg values for 
several consecutive cycles are needed before the alert is triggered.

To make the configuration easier, i think we can introduce some kind of "per 
CPU core" load average test, so the configuration will work the same regardless 
of CPU cores count, something like:

if loadavg(1m) per core > 1.9 then alert

Best regards,
Martin



> On 8 Apr 2019, at 15:38, Jamie Burchell  wrote:
> 
> Hi there
>  
> On the Monit documentation on “System resource tests” 
> (https://mmonit.com/monit/documentation/monit.html#System-resource-tests 
> ) 
> the “loadavg” figures look like they could be percentages rather than 
> absolute values. Is that correct, or am I misreading?
>  
> Most of the examples I’ve seen elsewhere for using the “loadavg” checks 
> appear to be using single figures 
> (https://mmonit.com/wiki/Monit/ConfigurationExamples 
>  - System Services).
>  
> If I’ve misunderstood then I’ll probably want to calculate these values based 
> on the number of processors – but not necessary if these are percentages?
>  
> TIA
> Jamie
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Mount and umount ceph volume

2019-03-18 Thread mart...@tildeslash.com
art
>>   filesystem type  ceph
>>   filesystem flags 
>> rw,relatime,name=admin,secret=,acl,wsize=16777216
>>   permission   755
>>   uid  27
>>   gid  27
>>   block size   4 MB
>>   space total  228 MB (of which 0.0% is reserved for root 
>> user)
>>   space free for non superuser 64 MB [28.1%]
>>   space free total 64 MB [28.1%]
>>   inodes total 165
>>   inodes free  -1 [-0.6%]
>>   data collected   Fri, 08 Mar 2019 00:35:28
>> 
>> System 'vdicnode04'
>>   status   OK
>>   monitoring statusMonitored
>>   monitoring mode  active
>>   on rebootstart
>>   load average [0.02] [0.20] [0.21]
>>   cpu  1.2%us 1.0%sy 0.0%wa
>>   memory usage 514.8 MB [28.3%]
>>   swap usage   0 B [0.0%]
>>   uptime   59m
>>   boot timeThu, 07 Mar 2019 23:40:21
>>   data collected   Fri, 08 Mar 2019 00:35:28
>> 
>> [root@vdicnode04 /]#
>> 
>> It gets stuck  in the "stop pending" status.
>> 
>> In logs I can see the following:
>> 
>> [CET Mar  8 00:39:55] info : 'check_cephfs' stop on user request
>> [CET Mar  8 00:39:55] info : Monit daemon with PID 121791 awakened
>> 
>> Of course, mount is still there until I execute manually the umount command:
>> 
>> [root@vdicnode04 /]# mount | grep ceph
>> 192.168.100.104:6789 <http://192.168.100.104:6789/>,192.168.100.105:6789 
>> <http://192.168.100.105:6789/>,192.168.100.106:6789:/ on 
>> /mnt/vdicube_ceph_fs type ceph 
>> (rw,relatime,name=admin,secret=,acl,wsize=16777216)
>> [root@vdicnode04 /]# umount -f -l /mnt/vdicube_ceph_fs
>> [root@vdicnode04 /]# mount | grep ceph
>> [root@vdicnode04 /]#
>> 
>> Even in this situation, monit status is still "stop pending"
>> 
>> [root@vdicnode04 /]# monit status
>> Monit 5.25.1 uptime: 4m
>> 
>> Filesystem 'check_cephfs'
>>   status   OK - stop pending
>>   monitoring statusMonitored
>> 
>> Any help will be welcome!
>> 
>> Óscar.
>> 
>> 
>> El jue., 7 mar. 2019 a las 22:06, mart...@tildeslash.com 
>> <mailto:mart...@tildeslash.com> (> <mailto:mart...@tildeslash.com>>) escribió:
>> Hi,
>> 
>> we didn't test with ceph, you can try generic configuration, for example:
>> 
>> check filesystem myfs with path /mydata
>> start program = ...#note: set the start command (mount)
>> stop program = ...  #note: set the stop command (umount)
>> 
>> It is possible that monit won't be able to collect I/O statistics ... in 
>> that case we can implement support for ceph.
>> 
>> Best regards,
>> Martin
>> 
>> 
>> > On 7 Mar 2019, at 15:55, Oscar Segarra > > <mailto:oscar.sega...@gmail.com>> wrote:
>> > 
>> > Hi,
>> > 
>> > I'd like to mount a cephfs filesystem when it is available (just checking 
>> > ceph metadata server tcp port).
>> > 
>> > And, on poweroff the server , i'd like to force umount the previous cephfs 
>> > volume if it is already mounted. This is because if ceph metadata server 
>> > is not available, the server loops infinitely trying to umount the cephfs 
>> > mount point.
>> > 
>> > Can theese two use cases be implemented with monit? 
>> > 
>> > Thanks a lot in advance 
>> > Óscar 
>> > -- 
>> > To unsubscribe:
>> > https://lists.nongnu.org/mailman/listinfo/monit-general 
>> > <https://lists.nongnu.org/mailman/listinfo/monit-general>
>> 
>> 
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
> 
> -- 
> Paul Theodoropoulos
> www.anastrophe.com <http://www.anastrophe.com/>-- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> <https://lists.nongnu.org/mailman/listinfo/monit-general>-- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: cpu wait usage of 307394485866725376.0%

2019-03-15 Thread mart...@tildeslash.com
Hello Stefan,

the problem was fixed in monit 5.25.3, changelog excerpt:

Fixed: The CPU user/system/wait statistics may show negative value if 
the system counter jumps back or wraps.

Best regards,
Martin


> On 15 Mar 2019, at 17:38, stefanx  wrote:
> 
> Hello,
> 
> I get the following message (Ubuntu 18.04, Monit version 5.25.1, Intel(R) 
> Core(TM) i7-8700 CPU @ 3.20GHz):
> 
> ...
> Resource limit matched
>   
>   
>
> Description: cpu wait usage of 307394485866725376.0% matches resource limit 
> [cpu wait usage > 300.0%]  
> 
> Any ideas ?
> 
> Thanks
> 
> Stefan
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Configure options for official release static binaries?

2019-03-09 Thread mart...@tildeslash.com
The binaries we distribute are just partially statically linked: with openssl 
and zlib. The libc is linked dynamically.

It makes sense to create a full static binary for ARM as these usually use 
various libc libraries more frequently than other platforms, which usually 
stick with glibc ... we'll look into it.

Best regards,
Martin


> On 9 Mar 2019, at 01:22, Martin Winter  wrote:
> 
> I’ve noticed that there are now binaries for arm8 online as well.
> 
> However, all the downloaded binaries seem to be now dynamically linked…
> (Webpage still talks about statically linked, but they are not.
> I’ve checked x86_64, arm7, arm8 linux binaries)
> 
> Small mistake on the published binaries?
> 
> Regards,
>   Martin Winter
> 
> 
> On 7 Mar 2019, at 12:14, mart...@tildeslash.com wrote:
> 
>> Hi,
>> 
>> we use the following configuration with static openssl and zlib builds:
>> 
>>  ./configure --with-ssl-static=$REPOSITORY --with-zlib=$REPOSITORY
>> 
>> Best regards,
>> Martin
>> 
>> 
>>> On 7 Mar 2019, at 17:50, Martin Winter  wrote:
>>> 
>>> Hi there,
>>> 
>>> curious on how the configure/build options are for official released 
>>> (static) binaries.
>>> I’ve attempted a few times to build similar static binaries but failed…
>>> 
>>> Background: I’m using monit on various Linux arm64 (arm8 CPU) servers, but 
>>> would
>>> prefer to use a single static binary to deploy as my servers are various 
>>> debian
>>> and ubuntu versions with different shared library versions.
>>> (There are currently no binaries provided for arm8)
>>> 
>>> Regards,
>>>  Martin Winter
>>> 
>>> -- 
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> 
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: monit not catching failed ping test

2019-03-08 Thread mart...@tildeslash.com
The interval between checks is 120 seconds => it can take up to ~2 minutes to 
detect error with this settings.

You can lower the interval to for example 5 seconds for faster error detection.

Best regards,
Martin


> On 8 Mar 2019, at 22:00, Fant, Andrew (NIH/NIDA) [E]  
> wrote:
> 
> In the monitrc file, I have:
>  
> set daemon   120
>  
> As for the monit -vi output, it has 22 remote host checks in total.  A 
> shortened, anonymized copy of it is:
>  
> Adding 'allow localhost' -- host resolved to [:::127.0.0.1]
> Adding credentials for user 'admin'
> Runtime constants:
>  Control file   = /etc/monitrc
>  Log file   = syslog
>  Pid file   = /etc/monit/monit.pid
>  Id file= /etc/monit/monit.id <http://monit.id/>
>  State file = /etc/monit/monit.state
>  Debug  = True
>  Log= True
>  Use syslog = True
>  Is Daemon  = True
>  Use process engine = True
>  Limits = {
> =   programOutput: 512 B
> =   sendExpectBuffer:  256 B
> =   fileContentBuffer: 512 B
> =   httpContentBuffer: 1 MB
> =   networkTimeout:5 s
> =   programTimeout:5 m
> =   stopTimeout:   30 s
> =   startTimeout:  30 s
> =   restartTimeout:30 s
> = }
>  On reboot  = start
>  Poll time  = 120 seconds with start delay 0 seconds
>  Event queue= base directory /var/monitor with 1000 slots
>  M/Monit(s) = http://[host1.local]:8080/collector 
> <http://[host1.local]:8080/collector> with timeout 5 s with credentials
>  Start monit httpd  = True
>  httpd bind address = localhost
>  httpd portnumber   = 2812
>  httpd signature= Enabled
>  httpd auth. style  = Basic Authentication and Host/Net allow list
>  
> The service list contains the following entries:
>  
> System Name   = host1
>  Monitoring mode  = active
>  On reboot= start
>  
> Remote Host Name  = host2_ping
>  Address  = 192.168.1.2
>  Monitoring mode  = active
>  On reboot= start
>  Ping = if failed [count 3 size 64 with timeout 5 s] then 
> alert
>  
> ---
>  
> Hopefully this will be of some use.
>  
>  
> --
> Andrew Fant  |Systems Administrator
> andrew.f...@nih.gov <mailto:andrew.f...@nih.gov>   |  Lei Shi Lab , 
> NIH/NIDA/IRP
> (443)740-2849   |
>  
> From: "mart...@tildeslash.com <mailto:mart...@tildeslash.com>" 
> mailto:mart...@tildeslash.com>>
> Reply-To: This is the general mailing list for monit 
> mailto:monit-general@nongnu.org>>
> Date: Friday, March 8, 2019 at 3:26 PM
> To: This is the general mailing list for monit  <mailto:monit-general@nongnu.org>>
> Subject: Re: monit not catching failed ping test
>  
> Hello, 
>  
> monit checks the service in intervals given by the "set daemon " settings. 
> If the interval between checks is long or the check is blocked by some 
> service timeout/action, then the interval can be longer.
>  
> Please can you check the "set daemon" settings and run monit in debug mode?:
>  
> 1.) stop monit
> 2.) monit -vI
>  
> Best regards,
> Martin
>  
> 
> 
> On 8 Mar 2019, at 16:49, Fant, Andrew (NIH/NIDA) [E]  <mailto:andrew.f...@nih.gov>> wrote:
>  
> Good morning.
>  I have a small monitoring setup with m/monit 3.7.2, using monit 5.25.2 
> as the agent.   There are a couple of systems that I cannot install monit on 
> that I still need to be aware of any downtime, so I have added them as ping 
> checks in the monitrc on the host where I installed m/monit.  Yesterday, one 
> of those remote systems went down, but monit and m/monit didn’t report an 
> alert for it and still have its status as OK.  Using anonymized information,  
> the entry in the monitrc on host1 is:
>  
> CHECK HOST host2_ping with ADDRESS 192.168.1.2
> IF FAILED ping THEN ALERT
>  
> And from the command line on host1:
>  
> host1% monit status host2_ping
> Monit 5.25.2 uptime: 48d 19h 8m
>  
> Remote Host 'host2_ping'
>   status   OK
>   monitoring statusMonitored
>   monitoring mode  active
>   on rebootstart
>   ping response time   -
>   data col

Re: monit not catching failed ping test

2019-03-08 Thread mart...@tildeslash.com
Hello,

monit checks the service in intervals given by the "set daemon " settings. 
If the interval between checks is long or the check is blocked by some service 
timeout/action, then the interval can be longer.

Please can you check the "set daemon" settings and run monit in debug mode?:

1.) stop monit
2.) monit -vI

Best regards,
Martin


> On 8 Mar 2019, at 16:49, Fant, Andrew (NIH/NIDA) [E]  
> wrote:
> 
> Good morning.
>  I have a small monitoring setup with m/monit 3.7.2, using monit 5.25.2 
> as the agent.   There are a couple of systems that I cannot install monit on 
> that I still need to be aware of any downtime, so I have added them as ping 
> checks in the monitrc on the host where I installed m/monit.  Yesterday, one 
> of those remote systems went down, but monit and m/monit didn’t report an 
> alert for it and still have its status as OK.  Using anonymized information,  
> the entry in the monitrc on host1 is:
>  
> CHECK HOST host2_ping with ADDRESS 192.168.1.2
> IF FAILED ping THEN ALERT
>  
> And from the command line on host1:
>  
> host1% monit status host2_ping
> Monit 5.25.2 uptime: 48d 19h 8m
>  
> Remote Host 'host2_ping'
>   status   OK
>   monitoring statusMonitored
>   monitoring mode  active
>   on rebootstart
>   ping response time   -
>   data collected   Fri, 08 Mar 2019 10:41:33
>  
> But:
>  
> host1% ping host2
> PING host2.example.org  (192.168.1.2) 56(84) bytes 
> of data.
> From host1.example.org  (192.168.1.1) icmp_seq=1 
> Destination Host Unreachable
> From host1.example.org  (192.168.1.1) icmp_seq=2 
> Destination Host Unreachable
> From host1.example.org  (192.168.1.1) icmp_seq=3 
> Destination Host Unreachable
>  
> Clearly there is a disconnect between the OS-provided ping utility and what 
> monit is seeing.   I’m sure that it’s probably a simple error in 
> configuration, but I am not seeing what I did wrong.   Can someone please set 
> me on the correct path?
>  
> Thank you
>  
> --
> Andrew Fant  |Systems Administrator
> andrew.f...@nih.gov    |  Lei Shi Lab , 
> NIH/NIDA/IRP
> (443)740-2849   |
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Mount and umount ceph volume

2019-03-07 Thread mart...@tildeslash.com
Hi,

we didn't test with ceph, you can try generic configuration, for example:

check filesystem myfs with path /mydata
start program = ...#note: set the start command (mount)
stop program = ...  #note: set the stop command (umount)

It is possible that monit won't be able to collect I/O statistics ... in that 
case we can implement support for ceph.

Best regards,
Martin


> On 7 Mar 2019, at 15:55, Oscar Segarra  wrote:
> 
> Hi,
> 
> I'd like to mount a cephfs filesystem when it is available (just checking 
> ceph metadata server tcp port).
> 
> And, on poweroff the server , i'd like to force umount the previous cephfs 
> volume if it is already mounted. This is because if ceph metadata server is 
> not available, the server loops infinitely trying to umount the cephfs mount 
> point.
> 
> Can theese two use cases be implemented with monit? 
> 
> Thanks a lot in advance 
> Óscar 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Configure options for official release static binaries?

2019-03-07 Thread mart...@tildeslash.com
Hi,

we use the following configuration with static openssl and zlib builds:

./configure --with-ssl-static=$REPOSITORY --with-zlib=$REPOSITORY

Best regards,
Martin


> On 7 Mar 2019, at 17:50, Martin Winter  wrote:
> 
> Hi there,
> 
> curious on how the configure/build options are for official released (static) 
> binaries.
> I’ve attempted a few times to build similar static binaries but failed…
> 
> Background: I’m using monit on various Linux arm64 (arm8 CPU) servers, but 
> would
> prefer to use a single static binary to deploy as my servers are various 
> debian
> and ubuntu versions with different shared library versions.
> (There are currently no binaries provided for arm8)
> 
> Regards,
>   Martin Winter
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

[Announce] Monit 5.25.3

2019-03-05 Thread mart...@tildeslash.com
Hi, all

We have just released Monit 5.25.3

Download:   https://mmonit.com/monit/#download


Release Notes:
==

This release contains two important security fixes, monit upgrade is highly 
recommended.

Please see https://mmonit.com/monit/changes/ for a complete and detailed list 
of changes in this release. 


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


Re: monit doesn't run stop action

2019-03-05 Thread mart...@tildeslash.com
Hi,

please can you add the configuration of "foo" and "bar" services?

There are for example these possible reasons:

1.) the "bar" service is a process and monit detected that the process is not 
running - in this case it gets a fast path and stop is skipped (the process is 
not running)

2.) there was a problem if you used "check program" in combination with the 
"every" statement ... fixed in monit 5.25.3: 
https://bitbucket.org/tildeslash/monit/issues/759

Best regards,
Martin


> On 5 Mar 2019, at 16:24, Marc Rossi  wrote:
> 
> Looking through source right now but figured I'd throw it out to list to see 
> if this is something obvious I'm doing wrong.
> 
> Long time monit user but on a few of our apps we have recently been having 
> problems with the shutdown action possibly not running.
> 
> For the app that DOES shut down properly logs show the following:
> 
> [CST Mar  4 17:00:02] info : 'foo' stop on user request
> [CST Mar  4 17:00:02] info : Monit daemon with PID 17733 awakened
> [CST Mar  4 17:00:02] info : Awakened by User defined signal 1
> [CST Mar  4 17:00:02] info : 'foo' stop: '/usr/bin/pkill -u nobody -f 
> /usr/local/bin/foo.py'
> [CST Mar  4 17:00:02] info : 'foo' stop action done
> 
> For the app that is not stopping properly logs show the following:
> 
> [CST Mar  4 15:15:01] info : 'bar' stop on user request
> [CST Mar  4 15:15:01] info : Monit daemon with PID 17733 awakened
> [CST Mar  4 15:15:01] info : Awakened by User defined signal 1
> [CST Mar  4 15:15:01] info : 'bar' stop action done
> 
> Could be a red herring but where is the stop action line in the second log 
> excerpt? Now the shutdown commands are indeed different between foo & bar but 
> still would expect to see the stop action listed.
> 
> TIA
> Marc
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Need help with monit procmatch

2018-12-11 Thread mart...@tildeslash.com
Please upgrade monit, you need version >= 5.12.0


> On 11 Dec 2018, at 06:53, rahul ramani  wrote:
> 
> Hi,
> 
> Monit version is  5.2.5
> 
> monit -V
> This is Monit version 5.2.5
> Copyright (C) 2000-2011 Tildeslash Ltd. All Rights Reserved.
> 
> 
> Thanks
> Rahul
> 
> 
> 
> On Tuesday, 11 December, 2018, 12:48:19 AM IST, mart...@tildeslash.com 
>  wrote:
> 
> 
> Hi,
> 
> which monit version it is?:
> 
>   monit -V
> 
> As mentioned, monit >= 5.12.0 should work fine with up to 4096 bytes long 
> commands.
> 
> 
> Best regards,
> Martin
> 
> 
>> On 10 Dec 2018, at 14:42, rahul ramani > <mailto:james_rahul2...@yahoo.co.in>> wrote:
>> 
>> Hi Martin,
>> 
>> Is there any way we can get this working by setting some limit in the 
>> configs ?
>> 
>> Thanks
>> Rahul
>> 
>> 
>> 
>> On Wednesday, 5 December, 2018, 7:10:48 AM IST, rahul ramani 
>> mailto:james_rahul2...@yahoo.co.in>> wrote:
>> 
>> 
>> Hi Martin,
>> 
>> There are 2069 characters in the process. copied the process in a test file
>> 
>> cat test | wc -c
>> 2069
>> 
>> size of test file
>> 4.0Ktest
>> 
>> Thanks
>> Rahul
>> 
>> 
>> 
>> On Wednesday, 5 December, 2018, 12:21:12 AM IST, mart...@tildeslash.com 
>> <mailto:mart...@tildeslash.com> > <mailto:mart...@tildeslash.com>> wrote:
>> 
>> 
>> Hello,
>> 
>> the limit for the command-line pattern is 4kB since monit 5.12.0 (was 1kB 
>> for monit <= 5.11.0)
>> 
>> Please can you provide the length of your command line? We can refactor the 
>> limit out or add a new option to "set limits" statement.
>> 
>> 
>> Best regards,
>> Martin
>> 
>> 
>> 
>>> On 4 Dec 2018, at 09:17, monit-general-boun...@nongnu.org 
>>> <mailto:monit-general-boun...@nongnu.org> wrote:
>>> 
>>> The attached message has been automatically discarded.
>>> From: rahul ramani >> <mailto:james_rahul2...@yahoo.co.in>>
>>> Subject: Need help with monit procmatch
>>> Date: 4 December 2018 at 09:17:18 CET
>>> To: "monit-general@nongnu.org <mailto:monit-general@nongnu.org>" 
>>> mailto:monit-general@nongnu.org>>
>>> Reply-To: rahul ramani >> <mailto:james_rahul2...@yahoo.co.in>>
>>> 
>>> 
>>> HI Monit Users,
>>> 
>>> I recently started using monit in infrastructure and came across a scenario 
>>> while using monit procmatch feature. Application which is being monitored 
>>> is a java application and the string that need to be matched exist at the 
>>> very end of the process string, now it seems procmatch is able to match the 
>>> string till a specific length there might be a limit to that and since the 
>>> string to be match exist at the end it is not able to catch it.
>>> 
>>> example: this is the process, and the
>>> STRINGTOMATCH exist at the end of the process
>>> 
>>> "/apps/java1.8/jre/bin/java -d64 -server -noverify -Xms4g -Xmx4g 
>>> -XX:MaxMetaspaceSize=256m 
>>>-XX:InitialCodeCacheSize=128m 
>>> -XX:ReservedCodeCacheSize=256m 
>>>-XX:CodeCacheMinimumFreeSpace=16m -XX:+UseG1GC 
>>>-XX:MaxGCPauseMillis=500  
>>> "
>>> 
>>> 
>>> Monit version used is 5.2.5 , so is there any way i can increase the limit 
>>> or any config parameter which can be updated. 
>>> 
>>> 
>>> 
>>> Thanks
>>> Rahul
>>> 
>>> 
>>> 
>> 
> 

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

Re: Need help with monit procmatch

2018-12-10 Thread mart...@tildeslash.com
Hi,

which monit version it is?:

monit -V

As mentioned, monit >= 5.12.0 should work fine with up to 4096 bytes long 
commands.


Best regards,
Martin


> On 10 Dec 2018, at 14:42, rahul ramani  wrote:
> 
> Hi Martin,
> 
> Is there any way we can get this working by setting some limit in the configs 
> ?
> 
> Thanks
> Rahul
> 
> 
> 
> On Wednesday, 5 December, 2018, 7:10:48 AM IST, rahul ramani 
>  wrote:
> 
> 
> Hi Martin,
> 
> There are 2069 characters in the process. copied the process in a test file
> 
> cat test | wc -c
> 2069
> 
> size of test file
> 4.0Ktest
> 
> Thanks
> Rahul
> 
> 
> 
> On Wednesday, 5 December, 2018, 12:21:12 AM IST, mart...@tildeslash.com 
>  wrote:
> 
> 
> Hello,
> 
> the limit for the command-line pattern is 4kB since monit 5.12.0 (was 1kB for 
> monit <= 5.11.0)
> 
> Please can you provide the length of your command line? We can refactor the 
> limit out or add a new option to "set limits" statement.
> 
> 
> Best regards,
> Martin
> 
> 
> 
>> On 4 Dec 2018, at 09:17, monit-general-boun...@nongnu.org 
>> <mailto:monit-general-boun...@nongnu.org> wrote:
>> 
>> The attached message has been automatically discarded.
>> From: rahul ramani > <mailto:james_rahul2...@yahoo.co.in>>
>> Subject: Need help with monit procmatch
>> Date: 4 December 2018 at 09:17:18 CET
>> To: "monit-general@nongnu.org <mailto:monit-general@nongnu.org>" 
>> mailto:monit-general@nongnu.org>>
>> Reply-To: rahul ramani > <mailto:james_rahul2...@yahoo.co.in>>
>> 
>> 
>> HI Monit Users,
>> 
>> I recently started using monit in infrastructure and came across a scenario 
>> while using monit procmatch feature. Application which is being monitored is 
>> a java application and the string that need to be matched exist at the very 
>> end of the process string, now it seems procmatch is able to match the 
>> string till a specific length there might be a limit to that and since the 
>> string to be match exist at the end it is not able to catch it.
>> 
>> example: this is the process, and the
>> STRINGTOMATCH exist at the end of the process
>> 
>> "/apps/java1.8/jre/bin/java -d64 -server -noverify -Xms4g -Xmx4g 
>> -XX:MaxMetaspaceSize=256m 
>>-XX:InitialCodeCacheSize=128m 
>> -XX:ReservedCodeCacheSize=256m 
>>-XX:CodeCacheMinimumFreeSpace=16m -XX:+UseG1GC 
>>-XX:MaxGCPauseMillis=500  
>> "
>> 
>> 
>> Monit version used is 5.2.5 , so is there any way i can increase the limit 
>> or any config parameter which can be updated. 
>> 
>> 
>> 
>> Thanks
>> Rahul
>> 
>> 
>> 
> 

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

Re: Auto-discard notification

2018-12-04 Thread mart...@tildeslash.com
Hello,

the limit for the command-line pattern is 4kB since monit 5.12.0 (was 1kB for 
monit <= 5.11.0)

Please can you provide the length of your command line? We can refactor the 
limit out or add a new option to "set limits" statement.


Best regards,
Martin



> On 4 Dec 2018, at 09:17, monit-general-boun...@nongnu.org wrote:
> 
> The attached message has been automatically discarded.
> From: rahul ramani 
> Subject: Need help with monit procmatch
> Date: 4 December 2018 at 09:17:18 CET
> To: "monit-general@nongnu.org" 
> Reply-To: rahul ramani 
> 
> 
> HI Monit Users,
> 
> I recently started using monit in infrastructure and came across a scenario 
> while using monit procmatch feature. Application which is being monitored is 
> a java application and the string that need to be matched exist at the very 
> end of the process string, now it seems procmatch is able to match the string 
> till a specific length there might be a limit to that and since the string to 
> be match exist at the end it is not able to catch it.
> 
> example: this is the process, and the
> STRINGTOMATCH exist at the end of the process
> 
> "/apps/java1.8/jre/bin/java -d64 -server -noverify -Xms4g -Xmx4g 
> -XX:MaxMetaspaceSize=256m 
>-XX:InitialCodeCacheSize=128m 
> -XX:ReservedCodeCacheSize=256m 
>-XX:CodeCacheMinimumFreeSpace=16m -XX:+UseG1GC 
>-XX:MaxGCPauseMillis=500  
> "
> 
> 
> Monit version used is 5.2.5 , so is there any way i can increase the limit or 
> any config parameter which can be updated. 
> 
> 
> 
> Thanks
> Rahul
> 
> 
> 

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

Re: upstart config causes hang

2018-12-04 Thread mart...@tildeslash.com
Hi,

please can you check logs?

You can also add the -v option to the exec line to enable monit debug mode.

Best regards,
Martin


> On 4 Dec 2018, at 09:54, Nick Upson  wrote:
> 
> Hi
> 
> I'm using the script linked below on centos 6, when I do "start 
> monit_upstart" or "stop monit_upstart" it just hangs.
> 
> 
> https://mmonit.com/wiki/Monit/Upstart 
> M/Monit | Wiki 
> mmonit.com 
> # This is an upstart script to keep monit running. # To install disable the 
> old way of doing things: # # /etc/init.d/monit stop && update-rc.d -f monit 
> remove # # then put this script here: # # /etc/init/monit.conf # # and reload 
> upstart configuration: # # initctl reload-configuration # # You can manually 
> start and stop monit like this: # # start monit # stop monit # description 
> "Monit service ...
> 
> 
> 
> Kind Regards,
> Nick
> 
> Nick Upson | Principal Operations Engineer
> office +44 01799   <>5 
> 88800  support 
> hotline +44 1799 399200 
> DDI +44 01799 588621 
> telensa.com  | @telensa 
>  | Linkedin 
> 
> IMPORTANT NOTICE: This e-mail message is intended to be received only by 
> persons entitled to receive the confidential information it may contain. 
> E-mail messages to clients of Telensa may contain information that is 
> confidential and legally privileged. Please do not read, copy, forward, or 
> store this message unless you are an intended recipient of it. If you have 
> received this message in error, please forward it to the sender and delete it 
> completely from your computer system. -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Host test with Server returned status 538226728

2018-11-16 Thread mart...@tildeslash.com
Hello Lutz,

please can you get a network trace of the communication between monit and 
manager.intern:5001 ?

Best regards,
Martin



> On 14 Nov 2018, at 15:07, lutz.ma...@freenet.de wrote:
> 
> Hello,
> I use some "if failed host" tests with a "check process" service, based on 
> monit 5.21.0 everything works well, but with monit 5.25.2 I got some problems 
> (monit is running on AIX 7.2).
> 
>  if failed host manager.intern port 5001 protocol http for 1 cycles then alert
> The test failed with "HTTP error: Server returned status 538226728" or "HTTP 
> error: Server returned status 538226808" all the time.
> 
>  if failed host manager.intern port 5001 for 1 cycles then alert
> The test seems to work. And these tests works like expected too.
>  if failed host manager.intern port 8081 protocol http for 10 cycles then
>  if failed host manager.intern port 8081 protocol http for 10 cycles then 
> exec "/usr/local/etc/monit/scripts/zexec.sh"
> else if succeeded then exec "/usr/local/etc/monit/scripts/zexec.sh"
> #  if failed host manager.intern port 8081 protocol http for 20 cycles then 
> restart
>  if failed host manager.intern port 5000 protocol http for 1 cycles then 
> alert  if failed host manager.intern port 5001 for 1 cycles then alert
>  if failed host manager.intern port 8081 protocol http for 30 cycles then 
> exec "/usr/local/etc/monit/scripts/manager.sh restart"
> 
> Any idea or suggestion, how to analyse where the http response (the returned 
> status "538226728") came from and what is going on with monit.
> 
> With regards,
> Lutz
> 
> p.s.
> The ports 8081 and 5001 are handled by a Jetty Webserver, the port 5000 is 
> not available (used for testing purpose only).
> 
> Appendage:
> monit log file, I start monit with -vv, but get some debug message only:
> The test with protocol http does not work, I got a status like 538226728.
> [MEZ Nov 14 12:55:36] debug: 'Manager' process is running with pid 
> 37224774
> [MEZ Nov 14 12:55:36] debug: 'Manager' process is running with pid 
> 37224774
> [MEZ Nov 14 12:55:36] debug: 'Manager' zombie check succeeded
> [MEZ Nov 14 12:55:36] debug: 'Manager' succeeded testing protocol [HTTP] 
> at [manager.intern]:8081 [TCP/IP] [response time 8.280 ms]
> [MEZ Nov 14 12:55:36] debug: 'Manager' connection succeeded to 
> [manager.intern]:8081 [TCP/IP]
> [MEZ Nov 14 12:55:36] debug: Socket test failed for [4.242.48.100]:5001 
> -- HTTP error: Server returned status 538226728
> [MEZ Nov 14 12:55:36] error: 'Manager' failed protocol test [HTTP] at 
> [manager.intern]:5001 [TCP/IP] -- HTTP error: Server returned status 538226728
> [MEZ Nov 14 12:55:36] debug: Socket test failed for [4.242.48.100]:5000 
> -- Connection refused
> [MEZ Nov 14 12:55:36] error: 'Manager' failed protocol test [HTTP] at 
> [manager.intern]:5000 [TCP/IP] -- Connection refused
> [MEZ Nov 14 12:55:36] debug: 'Manager' succeeded testing protocol [HTTP] 
> at [manager.intern]:8081 [TCP/IP] [response time 7.430 ms]
> [MEZ Nov 14 12:55:36] debug: 'Manager' connection succeeded to 
> [manager.intern]:8081 [TCP/IP]
> 
> And all the time I test the socket only, without protocol http, it seems to 
> me the test work well.
> [MEZ Nov 14 14:24:20] debug: 'Manager' process is running with pid 
> 37224774
> [MEZ Nov 14 14:24:20] debug: 'Manager' process is running with pid 
> 37224774
> [MEZ Nov 14 14:24:20] debug: 'Manager' zombie check succeeded
> [MEZ Nov 14 14:24:20] debug: 'Manager' succeeded testing protocol [HTTP] 
> at [manager.intern]:8081 [TCP/IP] [response time 9.834 ms]
> [MEZ Nov 14 14:24:20] debug: 'Manager' connection succeeded to 
> [manager.intern]:8081 [TCP/IP]
> [MEZ Nov 14 14:24:20] debug: 'Manager' succeeded testing protocol 
> [DEFAULT] at [manager.intern]:5001 [TCP/IP] [response time 8.403 ms]
> [MEZ Nov 14 14:24:20] debug: 'Manager' connection succeeded to 
> [manager.intern]:5001 [TCP/IP]
> [MEZ Nov 14 14:24:20] debug: Socket test failed for [4.242.48.100]:5000 
> -- Connection refused
> [MEZ Nov 14 14:24:20] error: 'Manager' failed protocol test [HTTP] at 
> [manager.intern]:5000 [TCP/IP] -- Connection refused
> [MEZ Nov 14 14:24:20] debug: 'Manager' succeeded testing protocol [HTTP] 
> at [manager.intern]:8081 [TCP/IP] [response time 12.121 ms]
> [MEZ Nov 14 14:24:20] debug: 'Manager' connection succeeded to 
> [manager.intern]:8081 [TCP/IP]
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: AssertException raised in StringBuffer_free

2018-11-04 Thread mart...@tildeslash.com
Hello,

please can you send coredump (if available) to supp...@mmonit.com?

There is one similar problem we solved recently, that can be duplicate of this 
issue: 
https://bitbucket.org/tildeslash/monit/issues/764/use-after-free-in-function-_handleevent

Best regards,
Martin


> On 3 Nov 2018, at 20:50, Lutz Mader  wrote:
> 
> Hello,
> I got the following problem (based on monit 5.25.2, Mac OS X 10.10).
> 
> [CET Nov  3 19:55:57] debug: 'file.log' content match skipped - file
> size nor inode has not changed since last test
> [CET Nov  3 19:55:57] info : 'file.log' content doesn't match
> [CET Nov  3 19:55:57] error: 'file.log' content match:
> Sa  3 Nov 2018 19:55:50 CET restart
> 
> [CET Nov  3 19:55:57] debug:
> ---
> [CET Nov  3 19:55:57] debug: 0   monit
> 0x000108259a3a log_backtrace + 74
> [CET Nov  3 19:55:57] debug: 1   monit
> 0x000108259399 LogError + 169
> [CET Nov  3 19:55:57] debug: 2   monit
> 0x000108254940 Event_post + 1552
> [CET Nov  3 19:55:57] debug: 3   monit
> 0x00010826a4f3 check_file + 2755
> [CET Nov  3 19:55:57] debug: 4   monit
> 0x000108252d68 _doStart + 168
> [CET Nov  3 19:55:57] debug: 5   monit
> 0x0001082531a9 _doDepend + 89
> [CET Nov  3 19:55:57] debug: 6   monit
> 0x000108252c81 control_service + 865
> [CET Nov  3 19:55:57] debug: 7   monit
> 0x0001082558b2 _handleAction + 946
> [CET Nov  3 19:55:57] debug: 8   monit
> 0x0001082548db Event_post + 1451
> [CET Nov  3 19:55:57] debug: 9   monit
> 0x00010826a4f3 check_file + 2755
> [CET Nov  3 19:55:57] debug: 10  monit
> 0x000108266d64 validate + 660
> [CET Nov  3 19:55:57] debug: 11  monit
> 0x00010825110a main + 3114
> [CET Nov  3 19:55:57] debug: 12  libdyld.dylib
> 0x7fff8f1815c9 start + 1
> [CET Nov  3 19:55:57] debug: 13  ???
> 0x0004 0x0 + 4
> [CET Nov  3 19:55:57] debug:
> ---
> [CET Nov  3 19:55:57] warning  : 'file.log' content match:
> Sa  3 Nov 2018 19:55:50 CET error
> Sa  3 Nov 2018 19:55:50 CET error
> 
> [CET Nov  3 19:55:57] info : 'wait.sh' start:
> '/usr/local/etc/monit/scripts/wait.sh start'
> [CET Nov  3 19:55:57] debug: 'wait.sh' started
> [CET Nov  3 19:55:57] critical : AssertException: S && *S
> raised in StringBuffer_free at src/util/StringBuffer.c:107
> 
> I try to use something like this to restart a process based on some
> messages.
> 
> check process wait.sh matching "sleep"
>  start program = "/usr/local/etc/monit/scripts/wait.sh start"
>  stop program = "/usr/local/etc/monit/scripts/wait.sh stop"
>  if cpu usage > 55% for 10 cycles then stop
>  depends on file.log
> 
> check file file.log with path "/var/log/file.log"
>  if not exist then exec "/usr/bin/touch /var/log/file.log"
>  if match "error" then alert
>  if match "restart" then restart
> 
> But all the time the message matched and try to restart, I got an
> exception and monit stop, see above.
> 
> Any idea,
> Lutz
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Unknown host showed up

2018-09-18 Thread mart...@tildeslash.com
Hi,

the "ipaddrin" column contains the client IP address as viewed by M/Monit - you 
can see it in the "Admin -> Host" page in the "Address" column. There are few 
exceptions:

1.) If the host is behind NAT/masquerading, it may not correspond to local IP 
address on the host

2.) If the monit configuration in "set httpd" column contains the "address" 
option, it's used instead of the client's address as Monit listens on that 
interface only ... that is most probably your case.

You can find the IP address of that host in the M/Monit access log. To enable 
the access log, modify the conf/server.xml configuration in M/Monit directory: 
uncomment the "AccessLogger" element and reload M/Monit.

Best regards,
Martin


> On 18 Sep 2018, at 09:25, Sorin Srbu  wrote:
> 
> Hi all,
> 
> An unknown host showed up in the hostlist in M/Monit called
> localhost.localdomain. It's most probably a misconfigured newly installed
> machine, but I can't seem to find its IP in M/Monit web-gui.
> 
> Is there anything special to it?
> 
> We use sqlite as a database in our small environment, so I figured it'd be
> easy to just open the db with eg DB browser for SQLite and look it up.
> I loaded the mmonit.db from /usr/local/mmonit/mmonit-3.7.1/db in the
> sqlite-browser, went to Browse data and choose the host table and found the
> host. It was the only one running monit v5.5.
> 
> Hostid points to  nameid which in turn points to a name  which points to
> "localhost.localdomain".
> 
> Is the ipaddrin column in the host table supposed to show just "localhost"?
> 
> But how do I find the ip-address??
> 
> I'd be grateful for some pointers.
> 
> -- 
> BW,
>   Sorin
> ---
> # Sorin Srbu, Sysadmin
> # Uppsala University
> # Dept of Medicinal Chemistry
> # Div of Org Pharm Chem
> # Box 574
> # SE-75123 Uppsala
> # Sweden  
> #
> # Phone: +46 (0)18-4714482
> # Visit: BMC, Husargatan 3, B5:404b
> # Web: https://www.ilk.uu.se/
> ---
> # O<  ASCII ribbon campaign - Against html E-mail 
> # http://tinyurl.com/ascii-ribbon-campaign
> #
> # This message was not sent from an iProduct!
> #
> # Please consider the environment before printing this email.
> # Join the campaign at http://thinkBeforePrinting.org
> #
> # MotD follows:
> CentOS: Built from packages provided by a company that rhymes with Dead Rat.
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Alert for Filesystem check does not work on CentOS 7

2018-09-16 Thread mart...@tildeslash.com
Hi,

please can you run monit in debug mode and send output?:

monit -vI

Best regards,
Martin


> On 14 Sep 2018, at 14:12, Gergely Dudas  wrote:
> 
> Hi,
> 
> We would like to use monit's filesystem check on CentOS 7, but unfortunately 
> it does not send any alert email.
> 
> Here is an example from monitrc what works on Ubuntu:
> 
>   check filesystem root_fs with path /
>  if space usage > 80% for 1 times within 3 cycles then alert
> 
> What's wrong on CentOS 7?
> 
> monit-5.25.1-1.el7.x86_64
> CentOS 7.5.1804
> 
> Thanks!
> 
> Regards,
> Gergely Dudas
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: process pid reuse

2018-08-02 Thread mart...@tildeslash.com
Hi,

you can use the pattern based process check instead of the pidfile to prevent 
this problem: https://mmonit.com/monit/documentation/monit.html#Process 


Best regards,
Martin


> On 2 Aug 2018, at 08:17, Ranjit Noronha  wrote:
> 
> Hi,
> 
> I am able to install monit and monitor some of my processes. Monit works very 
> nicely to restart my  processes when they fail.
> 
> I am using the pidfile to help recognize the process.
> 
> I have a question on process pid reuse.
> 
> Suppose a process crashes (seg faults) and its pid get recycled; ie some 
> non-related process comes in with the pid.
> 
> The original pid is still in the pidfile created originally.
> 
> How does Monit recognize that a pid is recycled and not the original process 
> (so now it should try to restart the original process).
> 
> -- 
> thanks,
> 
> --ranjit
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: "check now" command

2018-07-31 Thread mart...@tildeslash.com
i'd recommend to delegate the alert delivery to M/Monit - Monit itself doesn't 
aggregate alerts. 


> On 31 Jul 2018, at 21:29, SZÉPE Viktor  wrote:
> 
> Thank you.
> 
> While doing "monit validate" I've received as many alert emails as there are 
> checks.
> Can we do something about it?
> 
> 
> Idézem/Quoting mart...@tildeslash.com:
> 
>> Hi,
>> 
>> you can use "monit validate" to trigger the monitoring cycle and collect 
>> status.
>> 
>> The "check program" will have however one cycle delay, as monit currently 
>> collects the result the next cycle after the program is executed (to not 
>> block other tests).
>> 
>> Best regards,
>> Martin
>> 
>> 
>>> On 31 Jul 2018, at 10:31, SZÉPE Viktor  wrote:
>>> 
>>> Usually I need "check now" when I am debugging an unknown problem.
>>> 
>>> Idézem/Quoting Guillaume François :
>>> 
>>>> I would prefer something like:
>>>> check every 5 cycles when ok
>>>> check every 2 cycles when failling
>>>> 
>>>> check for quick recovery
>>>> 
>>>> or the way around (prefer to remove as fast as possible problematic server
>>>> from pool)
>>>> 
>>>> check every 1 cycle when ok
>>>> check every 10 cycle when failing
>>>> 
>>>> 
>>>> Currently this kind of thing can be achieve with two  excluding checks  and
>>>> enabling the other when "failling")
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Le mar. 31 juil. 2018 à 09:09, Roose, Marco  a
>>>> écrit :
>>>> 
>>>>> I very much like that idea!
>>>>> 
>>>>> Kind regards,
>>>>> Marco Roose
>>>>> 
>>>>> 
>>>>> -Original Message-
>>>>> From: monit-general >>>> mpibpc.mpg...@nongnu.org> On Behalf Of SZÉPE Viktor
>>>>> Sent: Monday, July 30, 2018 10:29 PM
>>>>> To: monit-general 
>>>>> Subject: "check now" command
>>>>> 
>>>>> Hello!
>>>>> 
>>>>> I am a happy monit user.
>>>>> 
>>>>> Sometime I face a situation when a check has a temporary problem.
>>>>> 
>>>>> # Number of resolvers
>>>>> check program network_resolv
>>>>>with path "/usr/local/sbin/server-integrity.sh -c RES -r 3" every
>>>>> 33 cycles
>>>>>   group integrity
>>>>>   if status != 0 then alert
>>>>> 
>>>>> So if it goes to "failed" status it would be nice to have a dedicated
>>>>> "check now" command that would evaluate the status of the check again.
>>>>> Work-arounds may exist but I am looking for a straight-forwards solution.
>>>>> (currently I issue monit reload for that with is not optimal)
>>>>> 
>>>>> Thanks!
>>>>> 
>>>>> 
>>>>> SZÉPE Viktor, honlap üzemeltetés / Running your application
>>>>> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
>>>>> --
>>>>> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
>>>>> Budapest, III. kerület
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> To unsubscribe:
>>>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>>>> --
>>>>> To unsubscribe:
>>>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>>> 
>>>> 
>>>> 
>>>> --
>>>> -BEGIN GEEK CODE BLOCK-
>>>> Version: 3.1
>>>> GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--?
>>>> w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-)
>>>> DI !D- G(+)>+ e+++ h--() r->$ y?*
>>>> --END GEEK CODE BLOCK--
>>> 
>>> 
>>> 
>>> SZÉPE Viktor, honlap üzemeltetés / Running your application
>>> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
>>> --
>>> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
>>> Budapest, III. kerület
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> 
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> 
> 
> SZÉPE Viktor, honlap üzemeltetés / Running your application
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: "check now" command

2018-07-31 Thread mart...@tildeslash.com
Hi,

you can use "monit validate" to trigger the monitoring cycle and collect status.

The "check program" will have however one cycle delay, as monit currently 
collects the result the next cycle after the program is executed (to not block 
other tests).

Best regards,
Martin


> On 31 Jul 2018, at 10:31, SZÉPE Viktor  wrote:
> 
> Usually I need "check now" when I am debugging an unknown problem.
> 
> Idézem/Quoting Guillaume François :
> 
>> I would prefer something like:
>> check every 5 cycles when ok
>> check every 2 cycles when failling
>> 
>> check for quick recovery
>> 
>> or the way around (prefer to remove as fast as possible problematic server
>> from pool)
>> 
>> check every 1 cycle when ok
>> check every 10 cycle when failing
>> 
>> 
>> Currently this kind of thing can be achieve with two  excluding checks  and
>> enabling the other when "failling")
>> 
>> 
>> 
>> 
>> 
>> Le mar. 31 juil. 2018 à 09:09, Roose, Marco  a
>> écrit :
>> 
>>> I very much like that idea!
>>> 
>>> Kind regards,
>>> Marco Roose
>>> 
>>> 
>>> -Original Message-
>>> From: monit-general >> mpibpc.mpg...@nongnu.org> On Behalf Of SZÉPE Viktor
>>> Sent: Monday, July 30, 2018 10:29 PM
>>> To: monit-general 
>>> Subject: "check now" command
>>> 
>>> Hello!
>>> 
>>> I am a happy monit user.
>>> 
>>> Sometime I face a situation when a check has a temporary problem.
>>> 
>>>  # Number of resolvers
>>>  check program network_resolv
>>> with path "/usr/local/sbin/server-integrity.sh -c RES -r 3" every
>>> 33 cycles
>>>group integrity
>>>if status != 0 then alert
>>> 
>>> So if it goes to "failed" status it would be nice to have a dedicated
>>> "check now" command that would evaluate the status of the check again.
>>> Work-arounds may exist but I am looking for a straight-forwards solution.
>>> (currently I issue monit reload for that with is not optimal)
>>> 
>>> Thanks!
>>> 
>>> 
>>> SZÉPE Viktor, honlap üzemeltetés / Running your application
>>> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
>>> --
>>> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
>>> Budapest, III. kerület
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> 
>> 
>> --
>> -BEGIN GEEK CODE BLOCK-
>> Version: 3.1
>> GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--?
>> w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-)
>> DI !D- G(+)>+ e+++ h--() r->$ y?*
>> --END GEEK CODE BLOCK--
> 
> 
> 
> SZÉPE Viktor, honlap üzemeltetés / Running your application
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: correct STARTTLS syntax for email alerts?

2018-07-30 Thread mart...@tildeslash.com
Yes, the "using TLS" and "using SSL" do the same (enable encryption) ... we 
have switched to "TLS" keyword to prevent confusion as the original SSLv[23] 
protocols are no longer safe and are disabled by default. The "SSL" keyword is 
still supported for backward compatibility.

Please can you get a network trace of the communication between monit and your 
mailserver on port 587 (for example using wireshark) and send it to 
supp...@mmonit.com?


> On 30 Jul 2018, at 23:08, David Newman  wrote:
> 
> On 7/30/18 12:05 PM, mart...@tildeslash.com wrote:
>> Thanks for data.
>> 
>> I tried to reproduce the problem with the following configuration and it 
>> seems to work correctly:
>> 
>> set mailserver mail8.networktest.com port 587
>>username "test" password "123456"
>>using tls
>> 
>> I get "Mail: Mailserver response error -- 535 5.7.8 Error: authentication 
>> failed" but that is expected (i didn't use real credentials). The 
>> credentials are send by monit past the STARTTLS command and the server 
>> didn't indicate the STARTLS error.
>> 
>> Please can you verify you monit is compiled with SSL?:
>> 
>>  monit -V
> 
> Yes, it appears to be:
> 
> This is Monit version 5.25.2
> Built with ssl, with ipv6, with compression, with pam and with large files
> Copyright (C) 2001-2018 Tildeslash Ltd. All Rights Reserved.
> dh
> 
> This is on FreeBSD 11.2-RELEASE, compiled from ports.
> 
> One delta between our configs, if it matters, is that your has 'set tls'
> instead of 'set ssl' in the 'set mailserver' definition. I don't think
> that's significant, as I changed mine, restarted monit, and saw the same
> STARTTLS error as before. I also tried commenting out the 'pemfile:'
> line in the 'set ssl' definition but that also had no effect.
> 
> An openssl STARTTLS handshake works OK from this server's command line.
> Output below.
> 
> Anything else I need to check in the monit config?
> 
> Thanks
> 
> dn
> 
> 
> $ openssl s_client -connect mail8.networktest.com:587 -starttls smtp
> CONNECTED(0003)
> depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3
> verify return:1
> depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
> verify return:1
> depth=0 CN = mail8.networktest.com
> verify return:1
> ---
> Certificate chain
> 0 s:/CN=mail8.networktest.com
>   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
> 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
>   i:/O=Digital Signature Trust Co./CN=DST Root CA X3
> ---
> Server certificate
> -BEGIN CERTIFICATE-
> MIIIjTCCB3WgAwIBAgISBN1aemqlVTdUmOJrX9BC59GGMA0GCSqGSIb3DQEBCwUA
> MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
> ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xODA2MDExMDAyMDRaFw0x
> ODA4MzAxMDAyMDRaMCAxHjAcBgNVBAMTFW1haWw4Lm5ldHdvcmt0ZXN0LmNvbTCC
> AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOI+gmM93ItcpEKZ34Ent14i
> Qd5rZ8bQFVJipwdxxkIgKWpUz6AJy4kaO0IIEDSquk7GTTpTFVsEcO+OVFDoE6Sg
> qo9S/oe7z1iOW6XVfoQb0PNp5yFdmTVP/fpYydxcZL34QDlP1+O1TRY0hTK6aOaq
> QkKnHrfFLiaKcLePKFcEPZgZW3aDPT3u3E38A9YFsOKaCQStZJxziV1QiaD4WlcJ
> qZWLfYSMR2DB7xMsSF+NXwItk9+fEl3yYDt3EwCXBWxE8lITUp5dq/bj03WhWpGe
> XD/e2WX0OUHClz1OH/NghnbMuBnL3jqEG/NXLKREqdDNdCfTA5krZZmNbuYx0qmR
> aosBLiteQf8XurK8wvg6jGxdrqZ0DudYPOADxRilHi27qse74OIoGJO6xxvrpzQt
> AZBvOIS6jM8MPrX1RdSE83LUqIzzAormy91Pb4gmSXvVywyoR5yqBiX3bmskzJdX
> BABsQ/vC8JYyszLpikZz4cYMfjpI15JwofaKIXeScwDR3rjXLcrmxk92J6dI3E1Y
> 0zaHaXb45ltUvT6mVqudWYNop/JAyxAcrH5pZ4TdUfeJjQDn5+H5p9EfXx8Q3eXE
> JdjRKmNIFjQvD9K3dNPi1QEkS8skv2t9LT5LydztovNvo9IpLsFBC92nFIPBpiHo
> Q/FOt/GOvEn05X4NROLLAgMBAAGjggSVMIIEkTAOBgNVHQ8BAf8EBAMCBaAwHQYD
> VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0O
> BBYEFLf08/9lmzsV+4SHI1UoJXPMnstCMB8GA1UdIwQYMBaAFKhKamMEfd265tE5
> t6ZFZe/zqOyhMG8GCCsGAQUFBwEBBGMwYTAuBggrBgEFBQcwAYYiaHR0cDovL29j
> c3AuaW50LXgzLmxldHNlbmNyeXB0Lm9yZzAvBggrBgEFBQcwAoYjaHR0cDovL2Nl
> cnQuaW50LXgzLmxldHNlbmNyeXB0Lm9yZy8wggGVBgNVHREEggGMMIIBiIIVbGlz
> dHMubmV0d29ya3Rlc3QuY29tghNsaXN0cy5wb3RyemViaWUub3JnghFsaXN0cy5z
> dWN0ZXN0LmNvbYIVbWFpbC5hdWRpb2FsY2hlbXkuY29tghBtYWlsLmN2Y2Jpa2Uu
> b3JnghptYWlsLmRhdmlkcm9iZXJ0bmV3bWFuLmNvbYISbWFpbC5kcm5zdHVkaW8u
> Y29tghRtYWlsLm5ldHdvcmt0ZXN0LmNvbYISbWFpbC5wb3RyemViaWUub3JnghRt
> YWlsLnJob2RhbmV3bWFuLmNvbYIQbWFpbC5zdWN0ZXN0LmNvbYIbbWFpbDguZGF2
> aWRyb2JlcnRuZXdtYW4uY29tghNtYWlsOC5kcm5zdHVkaW8uY29tghVtYWlsOC5u
> ZXR3b3JrdGVzdC5jb22CDXBvdHJ6ZWJpZS5vcmeCD3Job2RhbmV3bWFuLmNvbYIL
> c3VjdGVzdC5jb22CEXd3dy5wb3RyemViaWUub3JnghN3d3cucmhvZGFuZXdtYW4u
> Y29tMIH+BgNVHSAEgfYwgfMwCAYGZ4EMAQIBMIHmBgsrBgEEAYLfEwEBATCB1jAm
> BggrBgEFBQ

Re: correct STARTTLS syntax for email alerts?

2018-07-30 Thread mart...@tildeslash.com
Thanks for data.

I tried to reproduce the problem with the following configuration and it seems 
to work correctly:

set mailserver mail8.networktest.com port 587
username "test" password "123456"
using tls

I get "Mail: Mailserver response error -- 535 5.7.8 Error: authentication 
failed" but that is expected (i didn't use real credentials). The credentials 
are send by monit past the STARTTLS command and the server didn't indicate the 
STARTLS error.

Please can you verify you monit is compiled with SSL?:

monit -V




> On 30 Jul 2018, at 20:53, David Newman  wrote:
> 
> On 7/30/18 10:50 AM, mart...@tildeslash.com wrote:
> 
>> The configuration looks fine, please can you send Monit log?
> 
> It's just a lot of entries like this. I deliberately stopped the Mailman
> service to try to force an email alert from Monit.
> 
> Thanks in advance for any troubleshooting clues.
> 
> dn
> 
> [PDT Jul 29 16:03:50] info : Starting Monit 5.25.2 daemon with http
> interface at [localhost]:2812
> [PDT Jul 29 16:03:50] info : 'mail8.networktest.com' Monit 5.25.2
> started
> [PDT Jul 29 16:03:55] error: 'mailman' service restarted 1 times
> within 1 cycles(s) - alert
> [PDT Jul 29 16:03:55] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:03:55] error: Aborting event
> [PDT Jul 29 16:03:55] info : 'mailman' process is running after
> previous restart timeout (manually recovered?)
> [PDT Jul 29 16:03:55] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:03:55] error: Aborting event
> [PDT Jul 29 16:04:30] error: 'mailman' process is not running
> [PDT Jul 29 16:04:30] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:04:30] error: Aborting event
> [PDT Jul 29 16:04:30] info : 'mailman' trying to restart
> [PDT Jul 29 16:04:30] info : 'mailman' start:
> '/usr/local/etc/rc.d/mailman start'
> [PDT Jul 29 16:05:21] error: 'mailman' service restarted 1 times
> within 1 cycles(s) - alert
> [PDT Jul 29 16:05:21] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:05:21] error: Aborting event
> [PDT Jul 29 16:05:21] info : 'mailman' process is running with pid 18239
> [PDT Jul 29 16:05:21] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:05:21] error: Aborting event
> [PDT Jul 29 16:05:21] info : 'mailman' process is running after
> previous restart timeout (manually recovered?)
> [PDT Jul 29 16:05:21] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> [PDT Jul 29 16:05:21] error: Aborting event
> 
> 
> 
> 
> 
>> 
>> Best regards,
>> Martin
>> 
>> 
>>> On 30 Jul 2018, at 01:16, David Newman  wrote:
>>> 
>>> FreeBSD 11.2, monit-5.25.2 compiled from ports with SSL/TLS support
>>> 
>>> What's the correct syntax for monit to use STARTTLS when sending email
>>> alerts?
>>> 
>>> Currently monit logs this error:
>>> 
>>> [PDT Jul 29 16:05:21] error: Mail: Mailserver response error -- 530
>>> 5.7.0 Must issue a STARTTLS command first
>>> 
>>> Using this configuration in /usr/local/etc/monitrc:
>>> 
>>> set ssl options {
>>>   version: auto
>>>   verify: enable
>>>   pemfile: /etc/ssl/certs/mail.example.com/everything.pem
>>> }
>>> 
>>> set mailserver mail.example.com
>>> port 587
>>>   username "u...@example.com"
>>> password="wouldnt-you-like-to-know"
>>>   using ssl
>>> 
>>> check process mailman with pidfile
>>> /usr/local/mailman/data/master-qrunner.pid
>>>   group mailman
>>>   start program = "/usr/local/etc/rc.d/mailman start"
>>>   stop program = "/usr/local/etc/rc.d/mailman stop"
>>>   if 1 restarts within 1 cycles then alert
>>> 
>>> Thanks!
>>> 
>>> dn
>>> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: correct STARTTLS syntax for email alerts?

2018-07-30 Thread mart...@tildeslash.com
The configuration looks fine, please can you send Monit log?

Best regards,
Martin


> On 30 Jul 2018, at 01:16, David Newman  wrote:
> 
> FreeBSD 11.2, monit-5.25.2 compiled from ports with SSL/TLS support
> 
> What's the correct syntax for monit to use STARTTLS when sending email
> alerts?
> 
> Currently monit logs this error:
> 
> [PDT Jul 29 16:05:21] error: Mail: Mailserver response error -- 530
> 5.7.0 Must issue a STARTTLS command first
> 
> Using this configuration in /usr/local/etc/monitrc:
> 
> set ssl options {
>version: auto
>verify: enable
>pemfile: /etc/ssl/certs/mail.example.com/everything.pem
> }
> 
> set mailserver mail.example.com
>   port 587
>username "u...@example.com"
>   password="wouldnt-you-like-to-know"
>using ssl
> 
> check process mailman with pidfile
> /usr/local/mailman/data/master-qrunner.pid
>group mailman
>start program = "/usr/local/etc/rc.d/mailman start"
>stop program = "/usr/local/etc/rc.d/mailman stop"
>if 1 restarts within 1 cycles then alert
> 
> Thanks!
> 
> dn
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Notifications based on action events

2018-06-29 Thread mart...@tildeslash.com
Hello,

monit doesn't allow to catch the 'action' event - it is triggered as part of 
start/stop/restart/unmonitor/monitor action, i.e. if you need to call some 
script if one of these occurred, it should be part of the start/stop/restart 
method definition.

M/Monit allows to define a rule even for the 'action' event:




Best regards,
Martin


> On 26 Jun 2018, at 18:39, lutz.ma...@freenet.de wrote:
> 
> Hello Martin,
> you advise me to send notifications based on "action" events.
> I can't find any way in Monit to define/use "action" events,
> the (mail) alert statement is the only place to do this, I think.
> 
> But scripts can't called, based on a "action" event (like 
> monitor/start/stop/etc.).
> How to do this with Monit.
> 
> Thanks for any help,
> with regards,
> Lutz
> 
> Schon gewusst?! Neben dem E-Mail-Postfach bietet freenet.de auch eine
> INTEGRIERTE CLOUD-LÖSUNG MIT 3 GB SPEICHER und das alles KOMPLETT
> KOSTENFREI.
> https://email.freenet.de/index.html
> [https://email.freenet.de/index.html?utm_medium=Mail%20Basic_source=Mailfooter_campaign=Footer%20A=e990927_content=Link]
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Notification script in check program

2018-06-21 Thread mart...@tildeslash.com
Hi Lutz,

you can use multiple status tests within the 'check program' - if the status 
differs on program success, the second status check should catch it, something 
like this:

 check program myprogram with path "/usr/local/bin/helloworld"
   if status = 0 then exec "/usr/local/bin/script_no_1"
   if status > 0 then exec "/usr/local/bin/script_no_2"

Best regards,
Martin


> On 21 Jun 2018, at 23:24, Lutz Mader  wrote:
> 
> Hello Tildeslash,
> I use "CHECK PROGRAM" to do some additional application checks.
> Based on the return code and an appropriate "IF STATUS" rule I send
> alert/mail notifications from Monit.
> 
> This works well in the past, but I try to use a script to send SMS
> notifications now. I get the "Status failed" alerts, but the "Status
> succeeded" can not send.
> 
> Any plan to make the a "IF SUCCEEDED THEN" available for the "CHECK
> PROGRAM" in the future or any suggestion how to get a succeed notification.
> 
> With regards,
> Lutz
> 
> p.s.
> A status check with 0 doesn't work, because the service get the status
> "Status failed" with that.
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Send status notifications

2018-06-16 Thread mart...@tildeslash.com
Hello Lutz,

the CLI start/stop/restart/monitor/unmonitor action event is called "action" 
(stands for "user action") ... there is no rule in your configuration file for 
this event type which would trigger the script.  The rules in your 
configuration file will catch just anomalies (process stopped/died whereas it 
should be running). The notification should be send even with manual action, 
provided you didn't filter out the "action" event.


Best regards,
Martin


> On 16 Jun 2018, at 12:41, Lutz Mader  wrote:
> 
> Hello Tildeslash,
> I try to send status notifications to a central system, this works well
> all the time an application stopped by an failure or get some problems.
> 
> But all the time I use "monit stop" to stop an application I got no
> notification, the script will not called by Monit.
> 
> I used the following process definition in my test environment (with
> monit 5.25.1 and monit 5.21.0).
> 
> check process wait.sh matching "sleep"
>  start program = "/Users/lutz/Aufheben/monit/scripts/wait.sh"
>  stop program = "/Users/lutz/Aufheben/monit/scripts/wait.sh"
>  restart program = "/Users/lutz/Aufheben/monit/scripts/wait.sh"
>  if cpu usage > 55% for 10 cycles then stop
>  if not exist then restart
>  if not exist then exec "/Users/lutz/Aufheben/monit/scripts/zexec.sh"
>else if succeeded then exec
> "/Users/lutz/Aufheben/monit/scripts/zexec.sh"
> 
> The script "zexec.sh" is the notification script I used to send
> information to a central system (the central system send SMS or mail
> notifications).
> 
> wait.sh │ Does not exist │ Process
> :
> [CEST Jun 16 11:05:34] error: 'wait.sh' process is not running
> [CEST Jun 16 11:05:34] info : 'wait.sh' exec:
> '/Users/lutz/Aufheben/monit/scripts/zexec.sh'
> [CEST Jun 16 11:05:34] error: 'wait.sh' process is not running
> [CEST Jun 16 11:05:34] info : 'wait.sh' trying to restart
> [CEST Jun 16 11:05:34] info : 'wait.sh' restart:
> '/Users/lutz/Aufheben/monit/scripts/wait.sh'
> :
> [CEST Jun 16 11:06:36] info : 'wait.sh' process is running with pid
> 14501
> [CEST Jun 16 11:06:36] info : 'wait.sh' exec:
> '/Users/lutz/Aufheben/monit/scripts/zexec.sh'
> [CEST Jun 16 11:06:36] info : 'wait.sh' process is running with pid
> 14501
> :
> wait.sh │ OK │ Process
> 
> All the time a problem was recovery by Monit the notification script was
> called.
> 
> wait.sh │ OK │ Process
> monit stop wait.sh
> :
> [CEST Jun 16 11:06:59] info : 'wait.sh' stop on user request
> [CEST Jun 16 11:07:06] info : 'wait.sh' stop:
> '/Users/lutz/Aufheben/monit/scripts/wait.sh'
> [CEST Jun 16 11:07:37] error: 'wait.sh' failed to stop (exit status
> 0) -- no output
> [CEST Jun 16 11:07:37] info : 'wait.sh' stop action failed
> :
> wait.sh │ Not monitored  │ Process
> monit start wait.sh
> :
> [CEST Jun 16 11:08:32] info : 'wait.sh' start on user request
> [CEST Jun 16 11:08:32] info : 'wait.sh' start:
> '/Users/lutz/Aufheben/monit/scripts/wait.sh'
> [CEST Jun 16 11:08:32] info : 'wait.sh' start action done
> :
> wait.sh │ OK │ Process
> 
> But all the time I restart the application via Monit, the notification
> script was not called.
> 
> I try to use someting like this as well.
> 
> if changed pid then exec exec "/Users/lutz/Aufheben/monit/scripts/zexec.sh"
> 
> But get a notification on pid changes only, if the pid disappear, no
> notifications send.
> 
> Any idea how to get a status notification all the time, send by Monit
> itself (or via M/Monit).
> 
> Thanks for any suggestion,
> Lutz
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Building monit myself for Linux s390x

2018-06-03 Thread mart...@tildeslash.com
Hello Lutz,

the support for TLSv1.3 depends on the SSL library ... Monit has support for 
it. The TLSv1.3 is supported for example in the OpenSSL 1.1.0 or later.

Best regards,
Martin



> On 3 Jun 2018, at 21:13, Lutz Mader  wrote:
> 
> Hello Tildeslash,
> a question of understanding only.
> I participate in a project and build my own monit program, the people
> plan to use monit in a Linux (s390x) environment.
> 
> I find the following in the configure log:
> 
> checking for zlib.h... yes
> checking for PAM support... enabled
> checking for pam_start in -lpam... yes
> checking for static SSL support... enabled
> checking for SSLv2... yes
> checking for TLSv1.1... yes
> checking for TLSv1.2... yes
> checking for TLSv1.3... no
> checking for EC_KEY support... yes
> checking for ASN1_TIME_diff support... yes
> 
> This should be correct, TLSv1.3 is not available with OpenSSL 1.0.2m or
> OpenSSL 1.0.2o used to bind static to mont 5.25.1 or monit 5.25.2.
>> From my point of view, TLSV13 is an option for SSL settings only, but
> not available in the used OpenSSL libraries today (became available with
> OpenSSL 1.1.0h only, for example).
> 
> In a short word, TLSv1.3 is not available today, with monit 5.25.2?!
> 
> The first time I try to build monit, the libssl.a (and libcrypto.a)
> library was not found, because the useful ssl libraries are available in
> the lib64 folder only (I’m on a SLES 11, s390x 64-bit, system).
> 
> I add the lib64 folder to the configure script therefore, to get the
> 64-bit libraries.
> 
> # Check whether --with-ssl-static was given.
> if test "${with_ssl_static+set}" = set; then :
>  withval=$with_ssl_static;
>for dir in "$withval" "$withval/include"; do
>checksslincldir "$dir"
>done
>for dir in "$withval" "$withval/lib64“ "$withval/lib"; do
> 
> This is the way to bind static the OpenSSL libraries only.
> I’m wrong, perhaps?!
> 
> With Regards,
> Lutz
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

[Announce] Monit 5.25.2

2018-05-29 Thread mart...@tildeslash.com
Hi, all

We have just released Monit 5.25.2

Download:   https://mmonit.com/monit/#download


Release Notes:
==

Please see http://mmonit.com/monit/changes/ for a complete and detailed list of 
changes in this release. 


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


Re: ping issues

2018-05-17 Thread mart...@tildeslash.com
239.43.227)  48.931 ms 209.85.240.33 (209.85.240.33)  
> 41.331 ms 216.239.46.156 (216.239.46.156)  41.268 ms
> 20  216.239.47.251 (216.239.47.251)  50.622 ms 209.85.248.209 
> (209.85.248.209)  50.059 ms  50.042 ms
> 21  209.85.252.253 (209.85.252.253)  50.162 ms 209.85.248.209 
> (209.85.248.209)  50.939 ms 72.14.239.219 (72.14.239.219)  49.764 ms
> 22  216.239.50.5 (216.239.50.5)  51.618 ms * *
> 23  * * *
> 
> 
> On 5/17/18 09:44, mart...@tildeslash.com <mailto:mart...@tildeslash.com> 
> wrote:
>> Hello,
>> 
>> please can you get a network trace of failed ping tests?
>> 
>> Best regards,
>> Martin
>> 
>> 
>>> On 17 May 2018, at 05:45, Paul Theodoropoulos <p...@anastrophe.com> 
>>> <mailto:p...@anastrophe.com> wrote:
>>> 
>>> I'm running a little personal project on a shoestring budget - e.g. a 
>>> couple of AWS t2.nano instances, so everything needs to be stripped as bare 
>>> as possible.
>>> 
>>> Testing one of the servers from offsite, I can run a single byte (ignoring 
>>> overhead), single count ping from the command line no problem (Debian 
>>> Stretch).
>>> 
>>> root@b-ns: ~ # ping -c1 -s 1 a.ns.anastrophe.com
>>> PING a.ns.anastrophe.com (52.32.92.141) 1(29) bytes of data.
>>> 9 bytes from a.ns.anastrophe.com (52.32.92.141): icmp_seq=1 ttl=42
>>> 
>>> --- a.ns.anastrophe.com ping statistics ---
>>> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
>>> 
>>> etc etc
>>> 
>>> However, within monit, the smallest I can set the size is 20, anything less 
>>> and it fails.
>>> 
>>> check host a.ns-ping with address 52.32.92.141
>>> if failed
>>>ping4 count 3 size 20
>>>with timeout 15 seconds
>>> then exec /usr/local/bin/pushover
>>> 
>>> I can certainly live with 20 byte packets, but I'm wondering why less than 
>>> 20 bytes won't work in monit. The docs only say that the default is 64 
>>> bytes, but no minimum.
>>> 
>>> -- 
>>> Paul Theodoropoulos
>>> www.anastrophe.com <http://www.anastrophe.com/>
>>> 
>>> 
>>> -- 
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
> 
> -- 
> Paul Theodoropoulos
> www.anastrophe.com <http://www.anastrophe.com/>-- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: ping issues

2018-05-17 Thread mart...@tildeslash.com
Hello,

please can you get a network trace of failed ping tests?

Best regards,
Martin


> On 17 May 2018, at 05:45, Paul Theodoropoulos  wrote:
> 
> I'm running a little personal project on a shoestring budget - e.g. a couple 
> of AWS t2.nano instances, so everything needs to be stripped as bare as 
> possible.
> 
> Testing one of the servers from offsite, I can run a single byte (ignoring 
> overhead), single count ping from the command line no problem (Debian 
> Stretch).
> 
> root@b-ns: ~ # ping -c1 -s 1 a.ns.anastrophe.com
> PING a.ns.anastrophe.com (52.32.92.141) 1(29) bytes of data.
> 9 bytes from a.ns.anastrophe.com (52.32.92.141): icmp_seq=1 ttl=42
> 
> --- a.ns.anastrophe.com ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> 
> etc etc
> 
> However, within monit, the smallest I can set the size is 20, anything less 
> and it fails.
> 
> check host a.ns-ping with address 52.32.92.141
> if failed
>ping4 count 3 size 20
>with timeout 15 seconds
> then exec /usr/local/bin/pushover
> 
> I can certainly live with 20 byte packets, but I'm wondering why less than 20 
> bytes won't work in monit. The docs only say that the default is 64 bytes, 
> but no minimum.
> 
> -- 
> Paul Theodoropoulos
> www.anastrophe.com
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: master switch

2018-04-16 Thread mart...@tildeslash.com
Hi,

when we want to suppress all alerts for example when we want to reboot a server 
which is hosting lot of test machines without gracefully stopping these test 
hosts, we turn-off the "master switch" for the whole alert rule in M/Monit, 
then reboot and turn it on again when reboot finished:




> On 14 Apr 2018, at 10:50, SZÉPE Viktor  wrote:
> 
> 
> Good morning!
> 
> When there is a connection issue in the datacenter where my server is located
> Monit sends 1 zillion alerts.
> 
> What would be the preferred way to skip all network tests when there is a 
> network outage?
> 
> Thank you.
> 
> 
> SZÉPE Viktor, honlap üzemeltetés / Running your application
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> ügyelet/hotline: +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: local alerts

2018-03-28 Thread mart...@tildeslash.com
Hi,

the combination of global and local alert should work, provided it's not the 
same email address.

You can also add second "check file" for the same file, but the service name 
must be unique (it doesn't have to match the filename), for example:

--8<--
check file mylog_error with path /mylog.log
...

check file mylog_exception with path /mylog.log
...
--8<--

Best regards,
Martin


> On 28 Mar 2018, at 16:07, MacKenzie, Gordie  
> wrote:
> 
> Hi,
> I am configuring alerts for monitoring logfiles. I am currently looking for 
> multiple content in a particular logfile. I would like to be notified at one 
> email address for the occurrence of one string and at the global alert 
> configuration. Below, I’d like “ERROR” matches to go to the global email. I’d 
> like Exception to go to local alert. Currently, I’m getting both alerts to 
> the local alert only. I can’t add a second “check file” configuration for 
> that logfile (monit errors on that). Is there a way to do this?
>  
>  
> #global
> set alert mysupportem...@mydomain.com
>  
>  
> check file mylog.log with path /mylog.log
>  if content =  "ERROR" then alert  
>  if content =  "Exception" then alert
> alert myph...@mydomain.com  #local alert
>  
>  
>  
> Gordie MacKenzie   |  Integration Specialist  |  Nova Scotia Power
> T: 902-428-6924 |  F: 902-428-6114 
> E: gordie.macken...@nspower.ca
> www.nspower.ca  
> 
> Follow us on Twitter
> 
>  
>  
>  
> Canada Anti-Spam Law Notice – To stop receiving commercial electronic 
> messages from us, please forward this email to unsubscr...@nspower.ca with 
> the word “unsubscribe” in the subject line. | Nova Scotia Power | 1223 Lower 
> Water Street, Halifax NS B3J 3S8 | www.nspower.ca
> Confidentiality Notice - The email communication is considered confidential
> and is intended only for the recipient(s). If you received this email in 
> error,
> please contact the sender and delete the email. Unauthorized disclosure or
> copying of this email is prohibited.
> 
> Attachment Limits - Emera will not accept email larger than 20MB or emails 
> containing high risk attachments like ZIP, EXE or others that could contain 
> viruses.
> If you have a business need to send such an email, please contact the 
> recipient for instructions.
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Terminal Batch doesn't work always

2018-03-23 Thread mart...@tildeslash.com
Hello Lutz,

the color (ANSI escape sequence) is set on server-side and stripped by monit 
CLI if in batch mode. If you use curl to fetch the status in txt format 
directly, you need to strip the escape sequence yourselves, for example:

curl http://127.0.0.1:2812/_status  | 
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

We'll simplify the color handling in the future release.

Best regards,
Martin




> On 23 Mar 2018, at 14:19, Lutz Mader  wrote:
> 
> Hello Tildeslash,
> I try to gather the Service status summary via a curl request from an
> other/remote monit system to use the status in a local monit check
> program script.
> 
> curl 'http://admin:monit@macmini.local:2812/_summary?format=xml'
> or
> curl 'http://admin:monit@macmini.local:2812/_summary?format=text'
> 
> Unfortunately, I got the output in the terminal output format only.
> 
> I try to disable tabular output and colours completely in the monitrc
> used by monit.
> 
> set terminal batch
> 
> Nothing was happened, I got the terminal text format with tabular output
> and colours. But the tabular and colours are removed from the local
> monit command output (the monit daemon was restarted), the set terminal
> batch mode seems to be used (handled like -B).
> 
> My question is this the normal behaviour?
> How to get text only or xml output via curl for _summary?
> 
> With _status and format xml I got xml output, but many other
> informations also. And with format text I got the coloured output as well.
> 
> Thanks for any help or suggestion,
> Lutz
> 
> p.s.
> I use Monit 5.25.1 and 5.22.0, 5.19.0.
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Email Alerts with Process List

2018-03-22 Thread mart...@tildeslash.com
The "check program" description is set to script's output: 
https://mmonit.com/monit/documentation/monit.html#PROGRAM-STATUS-TEST


> On 20 Mar 2018, at 14:16, Gee Fitz  wrote:
> 
> Is it possible to include a list of processes with an alert?
> 
> message: $EVENT Service $SERVICE
> Date:$DATE
> Action:  $ACTION
> Host:$HOST
> Description: $DESCRIPTION
> 
> Debug:
> 
> $link_to_ps
> $link_to_lsof
> 
> Thanks in advance
> 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Monit using ethtool

2018-03-14 Thread mart...@tildeslash.com
You can check link errors with "check network" directly: 
https://mmonit.com/monit/documentation/monit.html#NETWORK-INTERFACE-TESTS

The current monit release will trigger a "link" event if rx/tx errors are 
detected.

If you want to integrate ethtool, you can use the "check program" with custom 
script: https://mmonit.com/monit/documentation/monit.html#PROGRAM-STATUS-TEST

Best regards,
Martin


> On 14 Mar 2018, at 18:30, Kevin Smith  wrote:
> 
> Any examples out there of monitoring network stats with monit via ethtool?
> Like if I wanted to track if a counter when up for one of the error counters 
> in ‘ethtool –S | grep error’
>  
> Thanks!
> 
> NOTICE: This email message is for the sole use of the intended recipient(s) 
> and may contain confidential and privileged information. Any unauthorized 
> use, disclosure or distribution is prohibited. If you are not the intended 
> recipient, please contact the sender by reply email and destroy all copies of 
> the original message.
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Remote mongodb host

2018-03-07 Thread mart...@tildeslash.com
No, the monit protocol test is basic implementation of the mongodb protocol - 
not full client.

If you need more complex test, you can use the "check program" with custom 
script that can use a mongodb client: 



> On 7 Mar 2018, at 22:20, Sar Haidar <shai...@mit.edu> wrote:
> 
> Thanks for the clarification. Would it work if I embed the credentials in the 
> connection string?
> 
>> On Mar 7, 2018, at 4:15 PM, mart...@tildeslash.com wrote:
>> 
>> The mongodb protocol test doesn't support an username and password
>> 
>> 
>> 
>>> On 7 Mar 2018, at 22:09, Sar Haidar <shai...@mit.edu> wrote:
>>> 
>>> I’m trying to use monit to verify the connection between a host running 
>>> monit and another host running mongodb. I was successfully able to write a 
>>> rule to do that for mysql, however, when I try it for mongodb, it fails and 
>>> I’m not sure what the correct syntax should be. This is what I have so far:
>>> 
>>> check host mongodb-host with address mongodb-server.example.com
>>> if failed port 27017 protocol mongodb username “monit" password “test" then 
>>> exec "/bin/sh -c /usr/local/bin/slack.sh”
>>> 
>>> When I run monit -t I get a syntax error ‘username’
>>> 
>>> I tried a few different ways and nothing seemed to work. Only way I was 
>>> able to make it work was by not using a username and password, but that 
>>> only works in a test case and not anywhere else.-- 
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> 
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Remote mongodb host

2018-03-07 Thread mart...@tildeslash.com
The mongodb protocol test doesn't support an username and password



> On 7 Mar 2018, at 22:09, Sar Haidar  wrote:
> 
> I’m trying to use monit to verify the connection between a host running monit 
> and another host running mongodb. I was successfully able to write a rule to 
> do that for mysql, however, when I try it for mongodb, it fails and I’m not 
> sure what the correct syntax should be. This is what I have so far:
> 
> check host mongodb-host with address mongodb-server.example.com
> if failed port 27017 protocol mongodb username “monit" password “test" then 
> exec "/bin/sh -c /usr/local/bin/slack.sh”
> 
> When I run monit -t I get a syntax error ‘username’
> 
> I tried a few different ways and nothing seemed to work. Only way I was able 
> to make it work was by not using a username and password, but that only works 
> in a test case and not anywhere else.-- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Monit check change ?

2018-02-22 Thread mart...@tildeslash.com
Hello Eric,

yes, you can set the content buffer size: 
https://mmonit.com/monit/documentation/monit.html#LIMITS


Best regards,
Martin


> On 22 Feb 2018, at 12:45, Eric Pailleau <e.paill...@numlog.fr> wrote:
> 
> Hello,
> 
> Looks like content match buffer is not more than 6 lines in our case,
> while some more entries was in the log when monit was executed.
> 
> Is there a configuration option that limit this buffer ?
> REgards
> 
> 
> Le 21/02/2018 à 12:53, Eric Pailleau a écrit :
>> Hello,
>> this is a problem actually for us.
>> 
>> We tried to do a workaround by treating several lines given as argument to 
>> our scripts,
>> but looks like monit miss some lines when already executing a command on a 
>> match.
>> 
>> Some new lines added in same time slot as not treated, even if we  
>> immediately background
>> the script for an immediate return.
>> Or there is maybe a limit on number on lines treated at once ?
>> 
>> Any idea to solve our issue ?
>> 
>> regards
>> 
>> 
>> Le 19/02/2018 à 23:37, mart...@tildeslash.com 
>> <mailto:mart...@tildeslash.com> a écrit :
>>> Hello,
>>> 
>>> yes, see Monit 5.4 changelog:
>>> 
>>> --8<--
>>> * The content match test now sends one event per cycle and pattern.
>>>   Even if there are multiple lines matching the same pattern, only
>>>   one event will be generated. Also the event rate is fixed now, so
>>>   it is possible to require match for X cycles before generating the
>>>   event.
>>> --8<--
>>> 
>>> Besy regards,
>>> Martin
>>> 
>>> 
>>>> On 19 Feb 2018, at 16:47, Eric Pailleau <e.paill...@numlog.fr> 
>>>> <mailto:e.paill...@numlog.fr> wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> we see a difference in monit regular expression check  of a file.
>>>> 
>>>> On former monit version looks like monit did a command on each line found,
>>>> while using  version 5.9 we got a command with all the lines matching 
>>>> since file increased its size.
>>>> 
>>>> Is there a way to have former behaviour ?
>>>> 
>>>> regards
>>>> 
>>>> Eric
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> To unsubscribe:
>>>> https://lists.nongnu.org/mailman/listinfo/monit-general 
>>>> <https://lists.nongnu.org/mailman/listinfo/monit-general>
>> 
>> 
>> -- 
>> 
>> 
>> 
> 
> 
> -- 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Monit check change ?

2018-02-19 Thread mart...@tildeslash.com
Hello,

yes, see Monit 5.4 changelog:

--8<--
* The content match test now sends one event per cycle and pattern.
  Even if there are multiple lines matching the same pattern, only
  one event will be generated. Also the event rate is fixed now, so
  it is possible to require match for X cycles before generating the
  event.
--8<--

Besy regards,
Martin


> On 19 Feb 2018, at 16:47, Eric Pailleau  wrote:
> 
> Hello,
> 
> we see a difference in monit regular expression check  of a file.
> 
> On former monit version looks like monit did a command on each line found,
> while using  version 5.9 we got a command with all the lines matching since 
> file increased its size.
> 
> Is there a way to have former behaviour ?
> 
> regards
> 
> Eric
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Single email from multiple related content matches

2018-02-08 Thread mart...@tildeslash.com
Hi,

which Monit version it is? (monit -V)

The Monit 5.4 or later should send only one email if the pattern matches 
multiple times in one cycle, changelog excerpt:

--8<--
* The content match test now sends one event per cycle and pattern.
  Even if there are multiple lines matching the same pattern, only
  one event will be generated. Also the event rate is fixed now, so
  it is possible to require match for X cycles before generating the
  event.
--8<--

If you have different patterns/tests, then Monit will send one email per test. 
The emails can be aggregated for example using M/Monit, which can collect 
events from Monit agents and aggregate: https://mmonit.com


Best regards,
Martin



> On 8 Feb 2018, at 19:23, Kevin Smith  wrote:
> 
> I have a content match set up for instance
> IF match “foo” within 1 cycle then alert (email).
>  
> But if “foo” matches 14 times in the same cycle, it sends 14 emails.  Is 
> there a way to make it only send 1 email, either for the 1st (or last) match 
> during that cycle, or 1 email with at 14 matches (preferred)?
>  
> Thanks!
>  
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Lots of "peer closed connection" errors for one machine

2018-01-24 Thread mart...@tildeslash.com
Hello,

please can you send the following files from M/Monit's log directory to 
supp...@mmonit.com?:

1.) mmonit.log
2.) error.log

Which M/Monit version it is? 

Which Monit version is on the peer side? 

Best regards,
Martin



> On 24 Jan 2018, at 20:00, Mike Gioia  wrote:
> 
> Hi M/Monit users -
> 
> I'm seeing tons of "peer closed connection" errors in my log file, 
> specifically for one machine. I have ~35 other machines that all connect 
> fine, but this one is failing repeatedly.
> 
> could not read request body -- peer closed connection
> 
> There's nothing else in the logs and I have the same firewall configuration 
> on this machine as the others. 2812 is accepted by the node, and 4 is 
> accepted by the m/monit instance, just like with all my other machines.
> 
> I'm at a loss as to what to do. The only difference between this machine and 
> all the others is that it's running Debian 8. Does anyone know where I can 
> look or what options I have? As far as I can tell it just seems to be a bug.
> 
> Thanks for your time,
> Mike
> 
> --
> Mike Gioia
> Chief Architect
> TeachBoost 
> m...@teachboost.com 
> 25 Broadway, 9th Floor, New York, NY 10004
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Case insensitive regex for MATCH - possible?

2018-01-09 Thread mart...@tildeslash.com
Hello,

Monit regex is currently case sensitive ... if you want case insensitive, you 
can:

1.) either rewrite the regex to case-insensitive, for example:

IF MATCH 
"(?i)[bB][aA][nN][eE][dD][|L][bB][lL][aA][cC][kK][lL][iI][sS][tT]" THEN ALERT

2.) or modify the regcomp() flags in src/p.y addmatch() function to include 
REG_ICASE flag and recompile monit:

regcomp(m->regex_comp, ms->match_string, 
REG_NOSUB|REG_EXTENDED|REG_ICASE);


Best regards,
Martin


> On 9 Jan 2018, at 10:21, Sebastian Arcus  wrote:
> 
> 
> On 09/01/18 09:02, Tino Hendricks wrote:
>>  Not having the need nor tested it, but the manual states regex is used 
>> according to http://man7.org/linux/man-pages/man7/regex.7.html
> 
> Thank you. I read that page while trying to figure things out. There is one 
> reference to "case-independent matching", but nothing to indicate how to use 
> it or what is the syntax for it. Searching more widely on the internet on 
> other software using the same regex library leads me back to the (?i) inline 
> syntax - which Monit doesn't appear to accept.
> 
> 
>> Best
>> Tino
>> Am 8. Januar 2018 um 22:58:26, Sebastian Arcus 
>> (s.ar...@open-t.co.uk(mailto:s.ar...@open-t.co.uk)) schrieb:
>>> Hello list. I might be missing something really obvious, but is it
>>> possible to do case insensitive matching with regex's in Monit? There
>>> doesn't seem to be anything about it in the docs, and bizarrely nothing
>>> relevant when searching in Google (to do strictly with regex's in
>>> Monit). I've tried something like:
>>>  IF MATCH "(?i)banned|blacklist" THEN ALERT
>>>  or
>>>  IF MATCH "/banned|blacklist/?i" THEN ALERT
>>>  Monit doesn't seem to like either. I've tried various ways suggested
>>> online for Javascript, Python etc. regular expressions - but so far I
>>> haven't been able to figure the right syntax. Any hints please?
>>>  --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Auto-discard notification

2018-01-09 Thread mart...@tildeslash.com
Hello,

please upgrade monit, the problem was fixed in 5.23.0, snip from changelog:

Fixed: Issue #603: Support existence/nonexistence test for filesystem 
check

Best regards,
Martin



> On 9 Jan 2018, at 17:40, monit-general-boun...@nongnu.org wrote:
> 
> The attached message has been automatically discarded.
> From: "Haarhoff, Daniel" 
> Subject: Repo unavailable // does not exist syntax error
> Date: 9 January 2018 at 17:40:08 CET
> To: "monit-general@nongnu.org" 
> 
> 
> Hiya list,
> 
> I just ran into an a unexpected syntax error:
> 
>  check filesystem storage with path /storage
>if does not exist then exec "zpool import storage && zfs mount -a"
>if space usage > 80% then alert
> 
> While the second 'if' has been working fine for months, the first 'if' gives 
> me a:
> 
> syntax error 'not'
> 
> I am running monit 5.20.0 on Debian stretch.
> 
> Any ideas are welcome ^^
> 
> 
> I originally intended to post an issue on bitbucket. But when trying to 
> access https://bitbucket.org/tildeslash/monit/ I get "Repository unavailable".
> 
> Is this on purpose? Bitbucket issue?
> 
> Cheers,
> Daniel
> 
> 
> 

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

Re: failing to stop a service means giving up on starting?

2018-01-06 Thread mart...@tildeslash.com
Hello,

if the stop method failed, it's not clear if it's safe to run the start method 
(the service is in kind of undefined state).

You can add a standalone restart method that will override the default 
stop+start sequence (the restart method can be better prepared for such 
exceptions then stop+start):

check process redis ...
start method = "/etc/init.d/redis-server start"
stop method = "/etc/init.d/redis-server stop"
restart method = "/etc/init.d/redis-server restart"


Best regards,
Martin



> On 4 Jan 2018, at 14:45, SZÉPE Viktor  wrote:
> 
> Hello!
> 
> Why there is no "start" attempt for 'redis' after the failed stop?
> 
> [UTC Jan  4 12:35:11] error: 'redis' failed protocol test [REDIS] at 
> [localhost]:6379 [TCP/IP] -- Connection refused
> [UTC Jan  4 12:35:12] info : 'redis' trying to restart
> [UTC Jan  4 12:35:12] info : 'redis' stop: '/etc/init.d/redis-server stop'
> [UTC Jan  4 12:35:42] error: 'redis' failed to stop (exit status -1) -- 
> '/etc/init.d/redis-server stop': Program timed out -- Stopping redis-server:
> 
> [UTC Jan  4 12:37:37] error: 'redis_test' status failed (1) -- no output
> [UTC Jan  4 12:37:37] info : 'olm2.olm.hu' swap usage check succeeded 
> [current swap usage=6.3%]
> [UTC Jan  4 12:37:37] info : 'olm2.olm.hu' mem usage check succeeded 
> [current mem usage=7.0%]
> 
> [UTC Jan  4 12:39:32] error: 'redis_test' status failed (1) -- no output
> 
> I'd like monit to keep on trying.
> Please advise.
> 
> 
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Can monit start services on remote host based on monitored host?

2018-01-06 Thread mart...@tildeslash.com
Yes, you can use 'exec' action and execute command on the remote host via ssh 
(you'll have to setup the ssh keys so it's possible to send commands - the 
access can be limited via ssh configuration for specific command only).

Best regards,
Martin


> On 4 Jan 2018, at 12:50, Muhamed Huseinbašić 
>  wrote:
> 
> Imagine this:
> Process 1 is running on host1.
> Process 2 is not yet running on host2.
> 
> Is it possible to achieve this with monit or m/monit:
> 
> If process 1 fails on host1, start the process 2 on host2 and start 
> monitoring the new process.
> If process 2 then, after some time, fails on host2, start process 1 on host1 
> again.
> 
> Thanks,
> Muhamed Huseinbašić
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: monit stops

2017-12-10 Thread mart...@tildeslash.com
Hello,

this problem was fixed already: 
https://bitbucket.org/tildeslash/monit/issues/501/monit-519-520-crashes-while-check-program
 


Best regards,
Martin


> On 10 Dec 2017, at 15:11, SZÉPE Viktor  wrote:
> 
> Good afternoon!
> 
> [UTC Dec 10 13:45:49] info : 'rngd' restart on user request
> [UTC Dec 10 13:45:49] info : Monit daemon with PID 26411 awakened
> [UTC Dec 10 13:45:49] info : 'rngd' trying to restart
> [UTC Dec 10 13:45:49] info : 'rngd' stop: '/etc/init.d/rng-tools stop'
> [UTC Dec 10 13:45:49] critical : AssertException: P
> raised in Process_exitStatus at src/system/Command.c:293
> 
> I issued monit restart rngd
> This is the config:
> 
> check process "rngd" with pidfile "/run/rngd.pid"
>   group "system"
>   group "rngd"
>   start program = "/etc/init.d/rng-tools start"
>   stop program = "/etc/init.d/rng-tools stop"
>   if 5 restarts with 5 cycles then unmonitor
>   depends on rngd_bin
>   depends on rngd_test
>   depends on rngd_rc
>   depends on rngd_init
> 
> check file "rngd_bin" with path "/usr/sbin/rngd"
>   group "rngd"
>   include "/etc/monit/templates/rootbin"
> 
> check program "rngd_test" with path "/usr/local/sbin/rng-tools-test.sh" with 
> timeout 10 seconds every 33 cycles
>   group "rngd"
>   if status != 0 then alert
> 
> check file "rngd_rc" with path "/etc/default/rng-tools"
>   group "rngd"
>   include "/etc/monit/templates/rootrc"
> 
> check file "rngd_init" with path "/etc/init.d/rng-tools"
>   group "rngd"
>   include "/etc/monit/templates/rootbin"
> 
> 
> v5.20.0
> Please advise.
> 
> 
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: [Announce] Monit 5.25.1 (monit RPM)

2017-11-17 Thread mart...@tildeslash.com
I don't know ... that's the question for monit's EPEL package maintainer.



> On 17 Nov 2017, at 23:53, Dimitri Yioulos <dyiou...@netatlantic.com> wrote:
> 
> Thanks for the reply, Martin.
> 
> I'm aware that I can build the RPM (used to do that quite a while ago), but 
> was hoping to stay with the EPEL build.  Any idea if it's still being 
> maintained by EPEL?
> 
> Dimitri
> 
> -Original Message-
> From: monit-general 
> [mailto:monit-general-bounces+dyioulos=netatlantic@nongnu.org] On Behalf 
> Of mart...@tildeslash.com
> Sent: Friday, November 17, 2017 5:51 PM
> To: This is the general mailing list for monit <monit-general@nongnu.org>
> Subject: Re: [Announce] Monit 5.25.1 (monit RPM)
> 
> Hi Dimitri,
> 
> you can build RPM directly from monit source code:
> 
>   rpmbuild -tb monit-5.25.1.tar.gz
> 
> Best regards,
> Martin
> 
> 
> 
>> On 17 Nov 2017, at 23:48, Dimitri Yioulos <dyiou...@netatlantic.com> wrote:
>> 
>> Hi, Martin.
>> 
>> Great news.
>> 
>> I've been installing Monit from the EPEL repo, but it's pretty far 
>> out-of-date.  I know you aren't involved with EPEL, at least not directly, 
>> but do you have any idea as to whether the EPEL release is being maintained?
>> 
>> Best,
>> 
>> Dimitri
>> 
>> -Original Message-
>> From: monit-general 
>> [mailto:monit-general-bounces+dyioulos=netatlantic@nongnu.org] On Behalf 
>> Of mart...@tildeslash.com
>> Sent: Friday, November 17, 2017 5:31 PM
>> To: This is the general mailing list for monit <monit-general@nongnu.org>
>> Subject: [Announce] Monit 5.25.1
>> 
>> Hi, all
>> 
>> We have just released Monit 5.25.1
>> 
>> Download:https://mmonit.com/monit/#download
>> 
>> 
>> Release Notes:
>> ==
>> 
>> Please see http://mmonit.com/monit/changes/ for a complete and detailed list 
>> of changes in this release. 
>> 
>> 
>> Contact:
>> 
>> 
>> If you have questions, comments or any other feedback about this release, 
>> please reply to this post.
>> 
>> 
>> Best regards from the Monit team
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> -- 
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: [Announce] Monit 5.25.1 (monit RPM)

2017-11-17 Thread mart...@tildeslash.com
Hi Dimitri,

you can build RPM directly from monit source code:

rpmbuild -tb monit-5.25.1.tar.gz

Best regards,
Martin



> On 17 Nov 2017, at 23:48, Dimitri Yioulos <dyiou...@netatlantic.com> wrote:
> 
> Hi, Martin.
> 
> Great news.
> 
> I've been installing Monit from the EPEL repo, but it's pretty far 
> out-of-date.  I know you aren't involved with EPEL, at least not directly, 
> but do you have any idea as to whether the EPEL release is being maintained?
> 
> Best,
> 
> Dimitri
> 
> -Original Message-
> From: monit-general 
> [mailto:monit-general-bounces+dyioulos=netatlantic@nongnu.org] On Behalf 
> Of mart...@tildeslash.com
> Sent: Friday, November 17, 2017 5:31 PM
> To: This is the general mailing list for monit <monit-general@nongnu.org>
> Subject: [Announce] Monit 5.25.1
> 
> Hi, all
> 
> We have just released Monit 5.25.1
> 
> Download: https://mmonit.com/monit/#download
> 
> 
> Release Notes:
> ==
> 
> Please see http://mmonit.com/monit/changes/ for a complete and detailed list 
> of changes in this release. 
> 
> 
> Contact:
> 
> 
> If you have questions, comments or any other feedback about this release, 
> please reply to this post.
> 
> 
> Best regards from the Monit team
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


[Announce] Monit 5.25.1

2017-11-17 Thread mart...@tildeslash.com
Hi, all

We have just released Monit 5.25.1

Download:   https://mmonit.com/monit/#download


Release Notes:
==

Please see http://mmonit.com/monit/changes/ for a complete and detailed list of 
changes in this release. 


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


Re: Problem with using multiple mail-format

2017-11-16 Thread mart...@tildeslash.com
Yes, the new event types will be more descriptive ... i'm busy with other stuff 
now, the extended event types may be available probably during Q1 2018.

Best regards,
Martin


> On 15 Nov 2017, at 15:03, Mancillas, Paul <pmancil...@eprod.com> wrote:
> 
> Martin,
> 
> You are correct. I am trying to make the email subject line more descriptive 
> (CPU, memory, etc.) instead of all of the emails saying "Resource limit 
> matched". When are you planning on extending the event types? Will the new 
> event types make the $EVENT more descriptive? In other words, when the CPU 
> usage exceeds the threshold is $EVENT going to say something like "CPU limit 
> matched" or maybe "CPU limit exceeded"? If not then will there be a way for 
> me to customize the value of $EVENT for each resource type?
> 
> Thanks,
> Paul
> 
> -Original Message-
> From: monit-general 
> [mailto:monit-general-bounces+pmancillas=eprod@nongnu.org 
> <mailto:monit-general-bounces+pmancillas=eprod@nongnu.org>] On Behalf Of 
> mart...@tildeslash.com <mailto:mart...@tildeslash.com>
> Sent: Wednesday, November 15, 2017 2:27 AM
> To: This is the general mailing list for monit <monit-general@nongnu.org 
> <mailto:monit-general@nongnu.org>>
> Subject: Re: Problem with using multiple mail-format
> 
> Hello,
> 
> the "set mail-format" statement can be used only once - if you use it 
> multiple times, only the last one of them will be used. Also one "check 
> system" can be used only once.
> 
> It is possible to override the mail-format for each recipient in the service 
> context (however in this case in won't help because of multiple "check 
> system" statements):
> 
> check system $HOST
>   if cpu usage > 50% for 1 cycles then alert
>   alert foo@bar with mail-format {
>   From: mo...@eprod.com
>   Subject: [$HOST] CPU $EVENT
>   Message: $DESCRIPTION
>   $DATE
>   }
> 
> It seems to me that the reason for your configuration is to differentiate the 
> catch-all "resource" type event, which is used for cpu, memory and other 
> resource usage tests. We plan to extend the event types (cpu will have its 
> own event, ditto for memory, space usage, etc) - i think this change will 
> solve your problem as well (no need to override the mailformat - the event 
> type will be more specific).
> 
> Best regards,
> Martin
> 
> 
> 
>> On 14 Nov 2017, at 16:09, Mancillas, Paul <pmancil...@eprod.com> wrote:
>> 
>> I am trying to setup system performance alerts using Monit 5.14. I have 
>> created several configuration files in /etc/monit.d like “cpu_alert” and 
>> “mem_alert”. Each of these files has a different mail-format section because 
>> I want the subject of the alert mail to show which resource is being 
>> overloaded. So the cpu_alert file looks like this:
>> 
>> set mail-format {
>>From: mo...@eprod.com
>>Subject: [$HOST] CPU $EVENT
>>Message: $DESCRIPTION
>> $DATE
>> }
>> check system $HOST
>>  if cpu usage > 50% for 1 cycles then alert
>> 
>> And the mem_alert file looks like this:
>> 
>> set mail-format {
>>From: mo...@eprod.com
>>Subject: [$HOST] Memory $EVENT
>>Message: $DESCRIPTION
>> $DATE
>> }
>> check system dvoellab01corp
>>  if memory usage > 20% for 1 cycles then alert
>> 
>> But when I tested this configuration by putting a high CPU and memory load 
>> on the server all of the email alerts say that they are “CPU” alerts. It’s 
>> like monit is using only the mail-format definition from the cpu_alert file 
>> and ignoring the mail-format from the mem_alert file. Has anyone seen this 
>> before? How can I fix this? The reason that I am using multiple 
>> configuration files is because I want to be able to use a different subject 
>> line and email destination for each type of resource bottleneck.
>> 
>> 
>> This message (including any attachments) is confidential and intended for a 
>> specific individual and purpose. If you are not the intended recipient, 
>> please notify the sender immediately and delete this message.
>> -- 
>> To unsubscribe:
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.nongnu.org_mailman_listinfo_monit-2Dgeneral=DwIGaQ=6zpojTjipf-nAlEmob0p1NKp0XhcK4Iau5zCDf5n3i4=VeywB-hbcQt2LM4ijEWtPDNhH3TLuCcS99DFc5jxsSA=W4aE0LG9FDrpApN8PUgp6MufEipp9Y3EUHRo6kU1d_M=i6c3eqPDAadB9kNJ88ylJJkK3rpQ-3SivxMC7acHVsg=
>>  
>> <https://urldefense.proofpoint.com/

Re: Problem with using multiple mail-format

2017-11-15 Thread mart...@tildeslash.com
Hello,

the "set mail-format" statement can be used only once - if you use it multiple 
times, only the last one of them will be used. Also one "check system" can be 
used only once.

It is possible to override the mail-format for each recipient in the service 
context (however in this case in won't help because of multiple "check system" 
statements):

check system $HOST
if cpu usage > 50% for 1 cycles then alert
alert foo@bar with mail-format {
From: mo...@eprod.com
Subject: [$HOST] CPU $EVENT
Message: $DESCRIPTION
$DATE
}
 
It seems to me that the reason for your configuration is to differentiate the 
catch-all "resource" type event, which is used for cpu, memory and other 
resource usage tests. We plan to extend the event types (cpu will have its own 
event, ditto for memory, space usage, etc) - i think this change will solve 
your problem as well (no need to override the mailformat - the event type will 
be more specific).

Best regards,
Martin



> On 14 Nov 2017, at 16:09, Mancillas, Paul  wrote:
> 
> I am trying to setup system performance alerts using Monit 5.14. I have 
> created several configuration files in /etc/monit.d like “cpu_alert” and 
> “mem_alert”. Each of these files has a different mail-format section because 
> I want the subject of the alert mail to show which resource is being 
> overloaded. So the cpu_alert file looks like this:
>  
> set mail-format {
> From: mo...@eprod.com
> Subject: [$HOST] CPU $EVENT
> Message: $DESCRIPTION
>  $DATE
> }
> check system $HOST
>   if cpu usage > 50% for 1 cycles then alert
>  
> And the mem_alert file looks like this:
>  
> set mail-format {
> From: mo...@eprod.com
> Subject: [$HOST] Memory $EVENT
> Message: $DESCRIPTION
>  $DATE
> }
> check system dvoellab01corp
>   if memory usage > 20% for 1 cycles then alert
>  
> But when I tested this configuration by putting a high CPU and memory load on 
> the server all of the email alerts say that they are “CPU” alerts. It’s like 
> monit is using only the mail-format definition from the cpu_alert file and 
> ignoring the mail-format from the mem_alert file. Has anyone seen this 
> before? How can I fix this? The reason that I am using multiple configuration 
> files is because I want to be able to use a different subject line and email 
> destination for each type of resource bottleneck.
> 
> 
> This message (including any attachments) is confidential and intended for a 
> specific individual and purpose. If you are not the intended recipient, 
> please notify the sender immediately and delete this message.
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Monit triggering restart storm

2017-11-09 Thread mart...@tildeslash.com
Hi,

if the start/stop methods are the same "/bin/systemctl [start|stop] myservice", 
then the solution should be the dependency of all 'check program' and 'check 
file' on the 'check process' parent.

If the dependant checks need to restart the parent process, they should do so 
via "... exec /usr/bin/monit restart myprocess" (unfortunately it's necessary 
to use the exec with monit CLI as there is currently no direct 
start/stop/restart action that would allow to pass the action to other check by 
name).

If the parent process will fail (for example the process is not running or port 
failed), the dependant checks will be aware about the parent restart and won't 
trigger another restart.


Example:

--8<--
check process myprocess matching "foobar"
start program = "/bin/systemctl start myservice"
stop program = "/bin/systemctl stop myservice"
if does not exist for 5 cycles then start
if failed port  for 6 times within 8 cycles then restart
if failed port  for 6 times within 8 cycles then restart
if failed port  for 6 times within 8 cycles then restart

check program myprocess_collector with path 
"/usr/bin/collect_report_from_myprocess.sh"
if status != 0 for 5 times within 10 cycles then exec "/usr/bin/monit 
restart myprocess"
depends on myprocess



check program myprocess_log with path 
"/usr/bin/collect_report_from_myprocess.sh"
if content = "BIG ERROR" then exec "/usr/bin/monit restart myprocess"
depends on myprocess
--8<--


Best regards,
Martin



> On 9 Nov 2017, at 12:07, Guillaume François  
> wrote:
> 
> Hi,
> 
> I have a bunch of Monit rules to perform check on a service
> One check process rule (existence and port checks)
> does not exist for 5 cycles then start 
>  failed port  for 6 times within 8 cycles then restart
>  failed port  for 6 times within 8 cycles then restart
>  failed port  for 6 times within 8 cycles then restart
> Three check program rules with custom checks
> if status != 0 for 5 times within 10 cycles then restart
> if status != 0 for 5 times within 10 cycles then restart
> if status != 0 for 5 times within 10 cycles then restart
> One to check log content
> check file  + if content = "BIG ERROR" then restart
> start/stop rules are 
> 
>   start program = "/bin/systemctl start myservice"
>   stop program = "/bin/systemctl stop myservice"
> 
> There are no dependency at Monit level but checks are part of the same bunch 
> of groups.
> 
> Problem, is that due to multiple issues, I got a "restart" storm as
> some  port check failed -> restart issued
> lead to error at custom script -> restart issued
> content log reading has some lags -> restart issued
> Myservice or system.d configuration/feature are not well designed so got 
> "already bind exception" as system.d tried to start several instance at the 
> same time樂 
> 
> So port check failed again, system.d killed the wrong one, MyService was 
> blocked, restart again. etc.
> 
> I had to shutdown Monit to prevent further action (I could have monit -g 
> group unmonitor also), kill every instance of my service, start it correctly, 
> then reactivate Monit
> 
> 
> Question: 
> Is there a native way to prevent Monit to issue the same start/stop commands 
> in a defined time-frame ?
> Does Monit dependency feature between checks could help as I don't see how it 
> could help ?
> Any other hint/proposal (aside increasing the values of "for N times within T 
> cycles" to delay the restart)
> Remark: maybe exploring system.D features StartLimitIntervalSe & 
> StartLimitBurst could help.
> 
> 
> Best Regards.
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

[Announce] Monit 5.25.0

2017-11-07 Thread mart...@tildeslash.com
Hi, all

We have just released Monit 5.25.0

Download:   https://mmonit.com/monit/#download 



Release Notes:
==

Please see http://mmonit.com/monit/changes/  
for a complete and detailed list of changes in this release. 


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Monit is not notifying me of PID changes

2017-10-18 Thread mart...@tildeslash.com
Hello,

the PID and PPID change tests are no longer implicit from Monit 5.11.0, 
changelog excerpt:

--8<--
New: The PID and PPID change tests are no longer implicit. If you
want to test the process PID/PPID changes, you have to add this test
explicitly:
if changed pid then alert
if changed ppid then alert
--8<--

Best regards,
Martin


> On 18 Oct 2017, at 21:56, Ragnar  wrote:
> 
> Hello,
> 
> I have monit 5.16 installed in Ubuntu 16.04 and I am not getting alerts of 
> PID changes. I get alerts of other monit events without any problems.
> 
> 
> My alerts are configured in monitrc as follows:
> 
> set alert hidden@hidden.hidden NOT ON { fsflags }
> 
> 
> My services config files looks like this:
> 
> check process nginx
>   with pidfile /var/run/nginx.pid
>   start "/etc/init.d/nginx start"
>   stop "/etc/init.d/nginx stop" 
>   
>   if failed host localhost port 443
>   then exec "/usr/local/bin/monit_slack_notification.sh"
>   else if succeeded
>   then exec "/usr/local/bin/monit_slack_notification.sh"
>   if not exist
>   then exec "/usr/local/bin/monit_slack_notification.sh"
>   else if succeeded
>   then exec "/usr/local/bin/monit_slack_notification.sh"
>   if failed host localhost port 443
>   then restart
>   if not exist
>   then restart
> 
> 
> If I restart Nginx manually (i.e. service nginx restart), the PID changes, 
> but I do not get the monit alert. What could be happening?
> 
> Thank you in advance.
> 
> Best Regards,
> Ragnar
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: monit alert mail message id issue

2017-10-18 Thread mart...@tildeslash.com
Hi,

the problem was fixed in Monit 5.2.4, changelog excerpt:

--8<--
* Randomize the mail message id to prevent duplicates in the case, that
  the same hostname is used on multiple hosts running monit and messages
  are generated in the same second in parallel. Thanks to Sergey B
  Kirpichev.
--8<--

Best regards,
Martin


> On 18 Oct 2017, at 16:43, Eric Pailleau  wrote:
> 
> Hi,
> yes I will do if I got confirmation this is a monit issue for monit guys.
> thanks.
> 
> 
> Le 18/10/2017 à 16:35, SZÉPE Viktor a écrit :
>> Try reporting it on Bitbucket: 
>> https://bitbucket.org/tildeslash/monit/issues/new 
>> 
>> 
>> Idézem/Quoting Eric Pailleau : 
>> 
>>> Hi Viktor, 
>>> yes I know this.  but I wonder if this message id is forged by monit or 
>>> not. 
>>> If monit create this id , this need more entropy. 
>>> 1508333561.0  1508333561.1 etc...  in same second, at least. 
>>> 
>>> monit guys may know if this issue is solved in upper version or not, too. 
>>> regards 
>>> 
>>> 
>>> Le 18/10/2017 à 16:17, SZÉPE Viktor a écrit : 
> message-id=<150833356...@mydomain.net> 
 
 It seems to be a timestamp based ID which it not precise enough for your 
 case. 
 
 
 Idézem/Quoting Eric Pailleau : 
 
> Hello, 
> forgot to mention that we use (quiet old ?) monit 5.2.3 
> but why change something running like a charm ;) ? 
> 
> 
> Le 18/10/2017 à 15:46, Eric Pailleau a écrit : 
>> Hello, 
>> 
>> I encountered a monit alert mail issue. 
>> 
>> I use simple config : 
>> 
>> check file no_acks with path /path/to/no_acks.log 
>> if match ".*" then alert 
>> 
>> So that monit effetively send a mail at each entry in this log. 
>> So far so good. 
>> 
>> But since we changed mail architecture, we did not received all the 
>> mails, 
>> but, by investigating , only the first one of all in the same second 
>> (using monit.log timestamp reference) 
>> 
>> We could find that imapd/cyrus  removed duplicate message ids and could 
>> add a special config entry disabling this option. 
>> 
>> Indeed we could see in postfix/smtpd that all the mails was relayed, but 
>> all in the same second add same ID : 
>> example : 
>> Oct 18 15:32:41 sv1 postfix/cleanup[31715]: 9AE25A87C51: 
>> message-id=<*1508333561.0*@mydomain.net> 
>> Oct 18 15:32:41 sv1 postfix/cleanup[31715]: A59FDA87C3D: 
>> message-id=<*1508333561.0*@mydomain.net> 
>> 
>> It is not clear to me if this is a monit or postfix issue. Is this mail 
>> id set by monit or postfix ? 
>> 
>> Thanks for sharing any thoughts on this. 
>> 
>> Regards 
>> Eric 
>> 
>> 
> 
> 
> -- 
 
 
 
 SZÉPE Viktor, honlap üzemeltetés 
 https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md 
>>> 
>>> 
>>> -- 
>> 
>> 
>> 
>> SZÉPE Viktor, honlap üzemeltetés 
>> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md 
> 
> 
> -- 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: monit alert -- Status failed network_resolv

2017-10-18 Thread mart...@tildeslash.com
Monit doesn't support such fallback currently, you can implement this in the 
exec action script (it would require the script to always exist).

Best regards,
Martin


> On 18 Oct 2017, at 11:02, Shakil Shaikh <ssha...@hotmail.com> wrote:
> 
> Hi Martin,
> 
> Like the OP I am getting an email as well as the script action (which I now 
> understand is as designed).
> 
> Is it possible to set up email as a backup/monit error alert?
> 
> Usage: I want to suppress emails in lieu of scripts, but if monit fails in 
> executing (script path is not available etc) then an email should be sent 
> with this error.
> 
> Or would this require a separate "file" check?
> 
> Thank you,
> 
> Shak
> 
> From: monit-general <monit-general-bounces+sshaikh=hotmail@nongnu.org> on 
> behalf of mart...@tildeslash.com <mart...@tildeslash.com>
> Sent: 18 October 2017 08:25
> To: This is the general mailing list for monit
> Subject: Re: monit alert -- Status failed network_resolv
>  
> Hello Viktor,
> 
> the 'alert' action is implicit, the alert is send too even if you have 'exec' 
> action => you can simplify the configuration:
> 
> original:
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
> 'https://hooks.slack.com/services... <https://hooks.slack.com/services...>'"
> 
> simplified (exec sends alert as well):
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
> 'https://hooks.slack.com/services... <https://hooks.slack.com/services...>'"
> 
> If you need to suppress the alert completely, you can do it in the service 
> context this way:
> 
>  check program network_resolv with path 
> "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
> if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
> 'https://hooks.slack.com/services... <https://hooks.slack.com/services...>'"
> noalert myuser@mydomain
> 
> 
> (we will clean the alert handling in the future - multiple coma separated 
> actions will be possible and custom alert channels will be supported)
> 
> 
> Best regards,
> Martin
> 
> 
> 
> > On 17 Oct 2017, at 23:13, SZÉPE Viktor <vik...@szepe.net> wrote:
> > 
> > Hello!
> > 
> > I may seem a rookie but why am I getting an email on the execution of a 
> > Slack script?
> > 
> > check program network_resolv
> >with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 
> > cycles
> >   group integrity
> >   if status != 0 then alert
> >   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
> > 'https://hooks.slack.com/services... <https://hooks.slack.com/services...>'"
> > 
> > All sources are available on GitHub: 
> > https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit
> >  
> > <https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit>
> > 
> > I've received a separate email with "Action: alert"
> > Please advise.
> > Thank you.
> > 
> > - Forwarded message from r...@example.com -
> >   Date: Tue, 17 Oct 2017 21:04:31 GMT
> >   From: r...@example.com
> > Subject: monit alert --  Status failed network_resolv
> > To: ad...@szepe.net
> > 
> > Status failed Service network_resolv
> > 
> >Date:Tue, 17 Oct 2017 21:04:31
> >Action:  exec
> >Host:www.example.com <http://www.example.com/>
> >Description: status failed (1) -- R:2001:4860:4860:: 2
> > 
> > Your faithful employee,
> > Monit
> > 
> > - End forwarded message -
> > 
> > 
> > SZÉPE Viktor, honlap üzemeltetés
> > https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md 
> > <https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md>
> > -- 
> > +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> > Budapest, III. kerület
> > 
> > 
> > 
> > 
> > 
> > -- 
> > To unsubscribe:
> > https://lists.nongnu.org/mailman/listinfo/monit-general 
> > <https://lists.nongnu.org/mailman/listinfo/monit-general>
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> <https://lists.nongnu.org/mailman/listinfo/monit-general>-- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> <https://lists.nongnu.org/mailman/listinfo/monit-general>
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: monit alert -- Status failed network_resolv

2017-10-18 Thread mart...@tildeslash.com
Hello Viktor,

the 'alert' action is implicit, the alert is send too even if you have 'exec' 
action => you can simplify the configuration:

original:
  if status != 0 then alert
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
'https://hooks.slack.com/services...'"

simplified (exec sends alert as well):
  if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
'https://hooks.slack.com/services...'"

If you need to suppress the alert completely, you can do it in the service 
context this way:

check program network_resolv with path 
"/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 cycles
if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
'https://hooks.slack.com/services...'"
noalert myuser@mydomain


(we will clean the alert handling in the future - multiple coma separated 
actions will be possible and custom alert channels will be supported)


Best regards,
Martin



> On 17 Oct 2017, at 23:13, SZÉPE Viktor  wrote:
> 
> Hello!
> 
> I may seem a rookie but why am I getting an email on the execution of a Slack 
> script?
> 
> check program network_resolv
>with path "/usr/local/sbin/server-integrity.sh -c RES -r '3'" every 33 
> cycles
>   group integrity
>   if status != 0 then alert
>   if status != 0 then exec "/usr/local/sbin/monit-slack.sh 
> 'https://hooks.slack.com/services...'"
> 
> All sources are available on GitHub: 
> https://github.com/szepeviktor/debian-server-tools/tree/master/monitoring/monit
> 
> I've received a separate email with "Action: alert"
> Please advise.
> Thank you.
> 
> - Forwarded message from r...@example.com -
>   Date: Tue, 17 Oct 2017 21:04:31 GMT
>   From: r...@example.com
> Subject: monit alert --  Status failed network_resolv
> To: ad...@szepe.net
> 
> Status failed Service network_resolv
> 
>   Date:Tue, 17 Oct 2017 21:04:31
>   Action:  exec
>   Host:www.example.com
>   Description: status failed (1) -- R:2001:4860:4860:: 2
> 
> Your faithful employee,
> Monit
> 
> - End forwarded message -
> 
> 
> SZÉPE Viktor, honlap üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Compiling embedding SSL lib

2017-10-06 Thread mart...@tildeslash.com
Hello,

we compile Monit with OpenSSL statically this way:

./configure --with-ssl-static=

You can also use the pre-compiled binaries: 
https://mmonit.com/monit/dist/binary/

Best regards,
Martin


> On 6 Oct 2017, at 16:46, Guillaume François  
> wrote:
> 
> Hello,
> 
> I'm trying to compile Monit in standalone way (i.e. embedding SSL libraries) 
> as I'm compiling on a host with OpenSSL 1.0.2 but the host where Monit will 
> be running is old and has only OpenSSL 1.0.0
> 
> I have tried several option to the "./configure" command but cannot find the 
> right one
> 
> Current error message when trying to start Monit on remote host.
> 
> /lib/x86_64-linux-gnu/libcrypto.so.1.0.0: version `OPENSSL_1.0.2' not found 
> (required by /usr/bin/monit)
> 
> Note:
> * I cannot update the remote host where Monit will run
> * I cannot downgrade the host where Monit is compiled
> * I need SSL feature as I'm checking Certificates date etc...
> 
> Regards.
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

[Announce] Monit 5.24.0

2017-09-24 Thread mart...@tildeslash.com
Hi, all

We have just released Monit 5.24.0

Download:   https://mmonit.com/monit/#download 



Release Notes:
==

Please see http://mmonit.com/monit/changes/  
for a complete and detailed list of changes in this release. 


Contact:


If you have questions, comments or any other feedback about this release, 
please reply to this post.


Best regards from the Monit team-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: Ignore Monit's First Alert

2017-09-19 Thread mart...@tildeslash.com
You can try this:

check host somehost with address somehost.com 
start program = "/opt/monit/scripts/somehostcheckport.sh start"
stop program = "/opt/monit/scripts/somehostport.sh stop"
if failed port 80 for 5 cycles then restart # note: will restart the 
service if down for 5 consecutive cycles, the alert is implicit (send as part 
of the restart)
alert n...@mail.com  with reminder on 5 cycles

Best regards,
Martin


> On 19 Sep 2017, at 08:41, Rizal Muttaqin  wrote:
> 
> 
> Use case: Send alert after particular port down 5 times within 5 cycles, 
> otherwise just ignore it. In other word, if particular port down less than 5 
> times within 5 cycles, don’t send any email. 
> >If particular port down continously, send alert every 5 cycles 
> 
> Reality: Monit sent alert every first port down state.
> 
> Question: How to ignore first alert? Should email reminder set on 1 cycles or 
> 5 cycles?
> 
> OS: CentOS 7
> 
> Monit version 5.14 from e17 epel repository
> 
> This is my monit configuration, the script basically contains a nmap command 
> for double checking port status functionality.
> #
> 
> set daemon 300 # 5 minutes per cycle
> check host somehost with address somehost.com 
> start program = "/opt/monit/scripts/somehostcheckport.sh start"
> 
> stop program = "/opt/monit/scripts/somehostport.sh stop"
> 
> if failed port 80 then restart
> 
> if 5 restart within 5 cycles then alert
> 
> alert n...@mail.com  with reminder on 5 cycles
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general 
> 
-- 
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Re: is it possible to enable basic-auth as default authentication method on M/Monit?

2017-09-17 Thread mart...@tildeslash.com
Hello Jorge,

the M/Monit GUI uses a FORM authentication, the BASIC-auth is used only for the 
status/events collector.

The FORM authentication example is described in the M/Monit HTTP-API 
documentation (you can use it with script or to create a custom dashboard): 
https://mmonit.com/documentation/http-api/Examples/cURL

Best regards,
Martin


> On 13 Sep 2017, at 23:09, Jorge Pereira  wrote:
> 
> 
> 
> -- 
> --
> Jorge Pereira
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: CSRF does not work in iframe.

2017-09-14 Thread mart...@tildeslash.com
Hello,

the Access-Control-Allow-Credentials is dangerous header.

Monit uses state-less double-submit-cookie pattern for CSRF defence: 
https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Double_Submit_Cookie
 ... the action will work when the request's "securitytoken" cookie and 
"securitytoken" http parameter will match - the value is not important, you can 
generate a new value for every request on client side (the defence is based in 
the fact, that the CSRF attacker cannot read nor set/modify the cookie value, 
so cannot set matching http parameter value).

Best regards,
Martin


> On 14 Sep 2017, at 06:13, Bhuvan Gupta  wrote:
> 
> Any help will be nice
> 
> On Thu, Sep 7, 2017 at 12:37 PM, Bhuvan Gupta  wrote:
> Hello all,
> 
>  I create a allMonit.html which have two iframe with src of two different 
> monit http interface running on two different system
> 
> allMonit.html structure
> http://firstserver:2812;>
> http://seconderver:2812;>
> 
> Now when i open allMonit.html in chrome , i see two monit interfaces. GREAT
> 
> Now if i try to let say "start a service" on one firstserver. I get invalid 
> CSRF.
> 
> Upon investigation i found that without iframe the http request contains a 
> cookiee header like 
> Cookie:securitytoken=6265d84a17c2715c7252c84d88a479cf
> Where as http request from iframe does not include cookie header.
> 
> Upon further study, i found that since monit http response does not contain 
> following header
> Access-Control-Allow-Credentials: true
> and hence browser will not transmit the cookie back to server.
> 
> Now the question arises:
> 
> QUESTION: How to configure monit to add addition http header
> 
> Thanks
> Bhuvan
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: nice value

2017-08-22 Thread mart...@tildeslash.com
Hello,

monit doesn't set the process priority - the default is 0, unless overridden 
via /etc/security/limits.conf priority settings. Also the child inherits 
parent's priority on fork (which occurs of Monit executes the start/stop 
program), i.e. if you're running Monit with lower priority, the processes 
executed by Monit will have by default the same priority as Monit.

Best regards,
Martin


> On 17 Aug 2017, at 11:47, SZÉPE Viktor  wrote:
> 
> 
> Hello!
> 
> Could it be that when monit re/starts a service
> 
>> /etc/init.d/mysql start
>> /etc/init.d/mysql stop
> 
> the nice level of that linux daemon may change to a non-zero value?
> 
> Thank you.
> 
> 
> SZÉPE Viktor, üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Manual page

2017-08-15 Thread mart...@tildeslash.com
Hello Vitor, fixed.

Best regards,
Martin


> On 10 Aug 2017, at 00:51, SZÉPE Viktor  wrote:
> 
> 
> Hello!
> 
> Would it be possible to add a  to the Manual page?
> 
>> https://mmonit.com/monit/documentation/monit.html
> 
> Maybe "Monit Manual"?
> 
> Thanks.
> 
> SZÉPE Viktor, üzemeltetés
> https://github.com/szepeviktor/debian-server-tools/blob/master/CV.md
> -- 
> +36-20-4242498  s...@szepe.net  skype: szepe.viktor
> Budapest, III. kerület
> 
> 
> 
> 
> 
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Problems with M/Monit reporting "Could not register a new connection with Reactor -- Too many open files"

2017-08-12 Thread mart...@tildeslash.com
Hello Jorge,

please can you send mmonit.log and error.log from M/Monit's "logs"  directory 
to supp...@mmonit.com ?

Which M/Monit version it is?

Best regards,
Martin


> On 12 Aug 2017, at 02:10, Jorge Pereira  wrote:
> 
> Hi,
> 
> The m/monit is reporting: 
> 
> "Could not register a new connection with Reactor -- Too many open files". 
> "[client xx.xx.xx.xx] could not read request body -- network error"
> 
> Has somebody some clue about it?
> 
> p.s: My current "file-max" is configured for 50
> 
> --
> Jorge Pereira
> -- 
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: how to disable a specific event globally on the m/monit?

2017-08-03 Thread mart...@tildeslash.com
Hello Jorge,

you can create an exclude list, for example to disable "Monit instance" events 
(Monit start/stop/reload):



Best regards,
Martin



> On 3 Aug 2017, at 04:39, Jorge Pereira  wrote:
> 
> Hello List,
> 
> how to disable a specific event globally on the m/monit?
>  
> --
> Jorge Pereira
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: "if failed gid disk then alert" throws syntax error

2017-08-03 Thread mart...@tildeslash.com
Hello Marcus,

the "disk" is now reserved word, you need to quote it if you want to use it as 
gid. Example:

check filesystem root_fs with path /dev/sda5
   if failed uid "root" then alert
   if failed gid "disk" then alert

Best regards,
Martin



> On 3 Aug 2017, at 16:44, Marcus Mülbüsch  
> wrote:
> 
> Hello all,
> 
> the following tests works well with monit-5.20.0
> 
>> check filesystem root_fs with path /dev/sda5
>>if failed uid root then alert
>>if failed gid disk then alert
> 
> as "ls -l /dev/sda5" shows (not surprisingly):
> 
>> brw-rw 1 root disk 8, 5 Aug  3 16:33 /dev/sda5
> 
> However, monit-5.22.0 cannot start:
> 
>> /usr/local/monit.d/filesytems.monit:18: syntax error 'disk'
> 
> I could switch to watching the numeric id of the user group disk, but would 
> rather keep all my configs unmodified!
> 
> Is there any workaround or fix?
> 
> Marcus
> 
> 
> 
> 
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: missing or invalid Authorization header

2017-07-18 Thread mart...@tildeslash.com
Hello Thomas,

this error is usually related to the first request the browser sends, as the 
browser doesn't "know" yet, that authorization is required. Monit sends a "401" 
response and browser then repeats the request with Basic authentication (some 
browsers send multiple requests in parallel, for example for favicon, so Monit 
may log two such errors at once). See for example 
https://en.wikipedia.org/wiki/Basic_access_authentication if you are interested 
in how Basic authentication works.

We have lowered the priority of this message from "error" to "debug" in Monit 
5.23.0, so it won't flood logs unless you enable the debug mode.

Best regards,
Martin



> On 18 Jul 2017, at 08:51, Thomas Lau  wrote:
> 
>  error: HttpRequest: access denied -- client 127.0.0.1 
> : missing or invalid Authorization header
> 
> 
> I keep seeing this on my log, anyone have idea why?
> 
> -- 
> Thomas Lau
> Director of Infrastructure
> Tetrion Capital Limited
> 
> Direct: +852-3976-8903
> Mobile: +852-9323-9670
> Address: Suite 2716, Two IFC, Central, Hong Kong
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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

Re: Planned Downtime

2017-07-18 Thread mart...@tildeslash.com
You can use the M/Monit HTTP-API to switch the host status to "ignored" before 
the planned downtime starts and back to "active" when it stops ... see the 
/admin/hosts/update method for details:

https://mmonit.com/documentation/http-api/Methods/Admin_Hosts

Example of simple script:

https://mmonit.com/documentation/http-api/Examples/cURL

Best regards,
Martin


> On 18 Jul 2017, at 08:38, Allen Wyma  wrote:
> 
> Sounds good, but this is in regards to M/Monit. Problem is we lose connection 
> to the M/Monit instance and M/Monit complains:
> 
> No report from Monit for 16 seconds: the network, the host or Monit is down. 
> Last report was 18 Jul 2017 06:40:29 +0800
>> On 18 Jul 2017, at 1:28 AM, Paul Theodoropoulos  wrote:
>> 
>> On 7/17/17 3:31 AM, Allen Wyma wrote:
>>> We do a daily backup of our VMs, and I’m curious if there’s a way to do a 
>>> planned downtime for the hosts everyday say from 5am until 5:30 or 
>>> something like that. Or would it just be easier to just cronjob turn off 
>>> and on my M/Monit instance?
>>> --
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>> 
>> monit has pseudo-cron capabilities.
>> 
>> # check some.application on db1
>> check program some.application.monitor
>> with path /usr/local/bin/check_application_wrapper
>> not every "00-30 05 * * *"
>> 
>> 
>> -- 
>> Paul Theodoropoulos
>> www.anastrophe.com
>> 
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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

Re: Check file and match behavior

2017-07-11 Thread mart...@tildeslash.com
Hi Lutz,

if your application log is set to a standalone file, you can test a 
modification timestamp if it logs some messages while it is running. For 
example (syntax for Monit >= 5.22.0):

check file myapp_log with path /var/log/myapp.log
if timestamp is older than 1 hour then exec "/usr/bin/monit 
restart myapp"

The test will restart "myapp" service if the timestamp was not modified within 
last hour.

You can see more details in monit manual: 
https://mmonit.com/monit/documentation/monit.html#TIMESTAMP-TEST

Best regards,
Martin


> On 10 Jul 2017, at 14:08, Lutz Mader  wrote:
> 
> Hi all folks,
> a question of understanding.
> 
> One of my applications hangs sometimes after the start.
> But the only hint that something is going wrong, the application does
> not continue to start, is the last message in the application log on the
> one hand. It's always the same message, I think.
> And on the other, that no additional messages are written to the log.
> 
> Unfortunately, if everything works well, all the messages are written to
> the log and some more messages also.
> And it is normal behaviour that the application stop writing messages to
> the log after the start, for a short time, sometimes.
> 
> My question,
> any suggestion how to check a message is the last one in the log for a
> given time. In my understanding, monit doesn't check a message already
> checked again, monit knows the last line in the log already checked.
> 
> A suggestion,
> any plan to set the service status based on messages.
> Today I use the port to check the application is up and running or
> restart the application if the port is not available.
> I use something like this.
> if failed host TheHostName port 5001 protocol http for 10 cycles then alert
> if failed host TheHostName port 8080 protocol http for 20 cycles then
> restart
> 
> Some of my application doesn't open a socket, I can't check a port also.
> But the log contain messages like "manager initialized" or "manager
> started".
> 
> Today I use commands to restart applications or disable the monitoring
> for applications based on messages are written to the application log or
> send mails.
> I use something like this.
> if match ".*Too many open files.*" then exec "/etc/monit/scripts/em.sh
> restart"
> if match ".*An attempt is made to stop the.*" then exec
> "/etc/monit/scripts/serv.sh unmonitor server1"
> if match "Press 'Enter' to acknowledge" then alert
> 
> But I don't know a command to set the service status.
> "monitor" or "unmonitor" enable/disable the monitoring only.
> 
> With regards,
> Lutz
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Directory size monitoring

2017-07-11 Thread mart...@tildeslash.com
Hi Lutz,

the directory size check was not implemented yet, you can observe the related 
task via bitbucket to get notified when it is implemented: 
https://bitbucket.org/tildeslash/monit/issues/191/check-directory-should-be-able-to-test-the

Best regards,
Martin



> On 10 Jul 2017, at 14:19, Lutz Mader  wrote:
> 
> Hi tildeslash,
> sometimes ago, someone ask for a function enhancement to check the size
> of a directory. As far as I know, this enhancement request was scheduled
> to a "later" release.
> 
> My question,
> any plan to make "size" available for "check directory" also.
> 
> Sorry, but the "directory size check" is one of the last scripts and I'm
> interesting in removing these scripts.
> 
> With regards,
> Lutz
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: [cpu temperature : graph]

2017-07-06 Thread mart...@tildeslash.com
Hi,

custom charts are currently not supported in M/Monit, we plan to add it.

Best regards,
Martin



> On 6 Jul 2017, at 06:38, LACROIX Jean Marc  wrote:
> 
> Hi,
> 
> Im am  monitoring the CPU temperature with success with following code :
> 
> cat /usr/local/bin/read_temperature_cpu_0.sh
> 
> # extract temperature as one 'int number' in order to exit with this value
> TEMP=`/usr/bin/sensors |grep "Core 0:" |awk '{print $3}' |awk '{printf 
> "%d",$1}'`
> exit $TEMP
> 
> 
> and 
> 
> cat /etc/monit/conf.d/monit_check_cpu_temperature
> 
> check program temp_cpu_0_thread_0_1 path 
> /usr/local/bin/read_temperature_cpu_0.sh
>if status > 60 then alert
>group temperature_CPU
> 
> 
> Is it possible to graph the temperature with report/analytic button in 
> M/monit, and if yes , how ?
> 
> Thanks in advance for your help
> 
> Regards
> -- 
> --
> -- Jean-Marc LACROIX --
>  -- mailto : jeanmarc.lacr...@free.fr --
>---
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Cannot add M/Monit as daemon

2017-06-28 Thread mart...@tildeslash.com
Yes.

If you need to automatically start Monit (the host agent), you can find the 
configuration here: https://mmonit.com/wiki/Monit/Starting

Best regards,
Martin


> On 28 Jun 2017, at 12:19, Sorin Srbu <sorin.s...@orgfarm.uu.se> wrote:
> 
>> -Original Message-
>> From: monit-general [mailto:monit-general-
>> bounces+sorin.srbu=orgfarm.uu...@nongnu.org] On Behalf Of
>> mart...@tildeslash.com
>> Sent: den 28 juni 2017 11:46
>> To: This is the general mailing list for monit <monit-general@nongnu.org>
>> Subject: Re: Cannot add M/Monit as daemon
>> 
>> Hello Sorin,
>> 
>> you can find recipes for automatic M/Monit startup here:
>> https://mmonit.com/wiki/MMonit/Setup#autolaunch.
>> 
>> The easiest way is to register M/Monit as a service in Monit - it will
> also make
>> M/Monit process visible in its own Reports.
>> 
>> 
>>  On 27 Jun 2017, at 10:04, Sorin Srbu <sorin.s...@orgfarm.uu.se
>> <mailto:sorin.s...@orgfarm.uu.se> > wrote:
>> 
>>  I'm trying to get M/Monit to automatically start at boot on a CentOS
> 6.9-server.
> 
> 
> Hello!
> 
> That would be done only on the M/Monit server holding web-gui, right?
> 
> -- 
> //Sorin
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


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


Re: Cannot add M/Monit as daemon

2017-06-28 Thread mart...@tildeslash.com
Hello Sorin,

you can find recipes for automatic M/Monit startup here: 
https://mmonit.com/wiki/MMonit/Setup#autolaunch 
.

The easiest way is to register M/Monit as a service in Monit - it will also 
make M/Monit process visible in its own Reports.

Best regards,
Martin


> On 27 Jun 2017, at 10:04, Sorin Srbu  wrote:
> 
> Hello all,
> 
> I'm trying to get M/Monit to automatically start at boot on a CentOS
> 6.9-server.
> Assuming this is easiest done by demonizing M/Monit I tried and got the
> below messages.
> 
> root@mach001 /etc/init.d/ [0]# chkconfig mmonit_init on
> service mmonit_init does not support chkconfig
> 
> root@mach001 /etc/init.d/ [0]# service mmonit_init restart
> Restarting mmonit: mmonitcat: /var/run/mmonit.pid: No such file or directory
> kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or
> kill -l [sigspec]
> 
> not running.
> root@mach001 /etc/init.d/ [0]#
> 
> root@mach001 /var/run/ [0]# whereis mmonit.pid
> mmonit: /usr/local/mmonit
> root@mach001 /var/run/ [0]#
> 
> root@mach001 /usr/local/mmonit/ [0]# ls -al
> total 16
> drwxr-xr-x   4 root root 4096 Apr 19 07:31 ./
> drwxr-xr-x. 13 root root 4096 Apr 19 07:29 ../
> drwxr-xr-x  10 root root 4096 Apr 19 07:29 mmonit-3.7.0/
> drwxr-xr-x  10 root root 4096 Apr 18 23:07 mmonit-3.7.1/
> root@mach001 /usr/local/mmonit/ [0]#
> 
> I don't get this...
> 
> Now, the weird thing is that M/Monit _is_ running.
> I just can't control it via the OS's own daemon system.
> 
> Is there any recommended practice to have M/Monit autostart on boot?
> 
> Thanks.
> 
> -- 
> BW,
>   Sorin
> ---
> # Sorin Srbu, Sysadmin
> # Uppsala University
> # Dept of Medicinal Chemistry
> # Div of Org Pharm Chem
> # Box 574
> # SE-75123 Uppsala
> # Sweden  
> #
> # Phone: +46 (0)18-4714482
> # Visit: BMC, Husargatan 3, D5:512b
> # Web: http://www.orgfarm.uu.se
> ---
> # O<  ASCII ribbon campaign - Against html E-mail 
> # http://tinyurl.com/ascii-ribbon-campaign
> #
> # This message was not sent from an iProduct!
> #
> # Please consider the environment before printing this email.
> # Join the campaign at http://thinkBeforePrinting.org
> #
> # MotD follows:
> People are always available for work in the past tense.
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

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