Hmm, this is strange, monit already supports DOS end-of-lines.
I have tested it today and it works good for me (tried on CVS version):
1.) configuration file /etc/monitrc in unix eol format:
--8<--
set daemon 5
set mailserver 127.0.0.1
set logfile /var/log/monit
set httpd port 2812 and allow 127.0.0.1
set alert address@hidden
check host mymailserver with address 192.168.1.1
if failed port 25 protocol smtp then alert
--8<--
2.) converted to dos format:
# unix2dos /etc/monitrc > /etc/monitrc-dos
3.) monit started:
# monit -vIc /etc/monitrc-dos
monit: Debug: Adding net allow '127.0.0.1'.
Runtime constants:
Control file = /etc/monitrc-dos
Log file = /var/log/monit
Pid file = /var/run/monit.pid
Debug = True
Log = True
Use syslog = False
Is Daemon = True
Use process engine = True
Poll time = 5 seconds
Mail server(s) = 127.0.0.1
Mail from = (not defined)
Mail subject = (not defined)
Mail message = (not defined)
Start monit httpd = True
httpd bind address = Any/All
httpd portnumber = 2812
httpd signature = True
Use ssl encryption = False
httpd auth. style = Basic Authentication and Host/Net allow list
Alert mail to = address@hidden
Alert on = All events
The service list contains the following entries:
Remote Host Name = mymailserver
Group = (not defined)
Monitoring mode = active
Port = if failed 192.168.1.1:25 [protocol SMTP] with
timeout 5 seconds 1 times within 1 cycle(s) then alert else if passed 1
times within 1 cycle(s) then alert
-------------------------------------------------------------------------------
Starting monit daemon with http interface at [*:2812]
Starting monit HTTP server at [*:2812]
monit HTTP server started
'system' load average [0.01][0.17][0.19]
'system' memory usage 43.3% [113576 kB]
'system' cpu usage 0.0%us 0.0%sy 0.0%wa
'mymailserver' succeeded testing protocol [SMTP] at INET[192.168.1.1:25]
Can you attach the output of 'monit -vI' and your configuration file in
dos format?
Thanks,
Martin
Michael Shigorin wrote:
Hello,
while deploying monit-4.5.1 on a few more hosts with "canned"
configuration and templates, I've found that it's getting
confused with DOS end-of-lines.
I understand the package examples are what needs fixing in the
first place but making monit less sensitive would be nice too.
------------------------------------------------------------------------
_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev
_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev