The monit command-line interface requires the HTTP interface, as it is used to pass commands from the monit command-line to monit daemon. You can disable it, but the command-line won't work in such case (as described by the error message when your http interface was disabled).
Regards, Martin > On 10 Nov 2015, at 16:18, frwa onto <[email protected]> wrote: > > Hi Martin, > Thank you about the monit stop and start I full understand > cause you dont want monit to start a service which have been stopped with > proper reason. Ok about the credentials my machine does not have gnome or > graphical ui. Is it ok if I set just like this and why cant we disable the > gui access as in my case I dont need it at all. > > set httpd port 2812 and > use address localhost # only accept connection from localhost > > > On Tue, Nov 10, 2015 at 6:07 PM, Martin Pala <[email protected] > <mailto:[email protected]>> wrote: > If you will call the start script manually, the service will be monitored > only if the monitoring was enabled already. In that case however - if the > process is stopped, monit will detect it and will try to restart it > automatically, so if you monitor some service via monit, you should use > "monit stop <service>" and "monit start <service>" to disable/enable > monitoring as well. > > The default credentials should be changed for obvious reason - they're well > known and if somebody will have user account on your machine, he may try to > connect to the monit http gui (as he'll be on "localhost") and can try the > default credentials. It is better to change both the username and password to > some custom value. > > >> On 10 Nov 2015, at 10:02, frwa onto <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hi Martin, >> I am a bit confused. Even if I start manually using >> ./startDaemon.sh monit is monitoring it right please correct me? Another >> thing do you want me to change this (you should change the credentials to >> something else then default "admin:monit") any reason? If I dont enable it >> does not work right? >> >> >> >> On Tue, Nov 10, 2015 at 3:43 PM, Martin Pala <[email protected] >> <mailto:[email protected]>> wrote: >> If you start the service via monit, monit will start monitoring it. >> >> The mentioned "set httpd" statement doesn't allow connections from outside, >> as it sets monit to listen on localhost (127.0.0.1) only and also sets ACL >> to allow access only from localhost (127.0.0.1) and using correct >> credentials (you should change the credentials to something else then >> default "admin:monit"). >> >> Regards, >> Martin >> >> >>> On 10 Nov 2015, at 05:22, frwa onto <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hi Martin, >>> Thank you I just did service monit restart and now it works. >>> My next question what is different between starting using say monit start >>> service1 or using the other method ./startDaemon.sh. I notice in both >>> methods when the missing pid monit do restart my app ? >>> >>> Another thing just to confirm with you by enabling it am I allowing port >>> 2812 access from outside or will this post any security concern even though >>> I am not using the web version? >>> >>> set httpd port 2812 and >>> use address localhost # only accept connection from localhost >>> allow localhost # allow localhost to connect to the server and >>> allow admin:monit # require user 'admin' with password 'monit' >>> >>> On Tue, Nov 10, 2015 at 1:03 AM, Martin Pala <[email protected] >>> <mailto:[email protected]>> wrote: >>> Please make sure you did "monit reload" after configuration changes. >>> >>> Regards, >>> Martin >>> >>> >>> >>>> On 09 Nov 2015, at 16:49, frwa onto <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> >>>> Hi Martin, >>>> In my version I did this >>>> >>>> ## Monit has an embedded web server which can be used to view status of >>>> ## services monitored and manage services from a web interface. See the >>>> ## Monit Wiki if you want to enable SSL for the web server. >>>> # >>>> set httpd port 2812 and >>>> use address localhost # only accept connection from localhost >>>> allow localhost # allow localhost to connect to the server and >>>> allow admin:monit # require user 'admin' with password 'monit' >>>> # allow @monit # allow users of group 'monit' to connect (rw) >>>> # allow @users readonly # allow users of group 'users' to connect >>>> readonly >>>> # >>>> must I do any other configuration for port 2812 ? Cause I get this error >>>> Cannot create socket to [localhost]:2812 -- Connection refused >>>> In my case my centos is bare minimal with got gnome nothing ? >>>> >>>> >>>> >>>> On Mon, Nov 9, 2015 at 11:39 PM, Martin Pala <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> You need to add it to the monit configuration file ... it is part of >>>> default configuration file, snip: >>>> >>>> --8<-- >>>> ## Monit has an embedded HTTP interface which can be used to view status of >>>> ## services monitored and manage services from a web interface. The HTTP >>>> ## interface is also required if you want to issue Monit commands from the >>>> ## command line, such as 'monit status' or 'monit restart service' The >>>> reason >>>> ## for this is that the Monit client uses the HTTP interface to send these >>>> ## commands to a running Monit daemon. See the Monit Wiki if you want to >>>> ## enable SSL for the HTTP interface. >>>> # >>>> set httpd port 2812 and >>>> use address localhost # only accept connection from localhost >>>> allow localhost # allow localhost to connect to the server and >>>> allow admin:monit # require user 'admin' with password 'monit' >>>> --8<-- >>>> >>>> See monit manual for details. >>>> >>>> >>>> > On 09 Nov 2015, at 16:30, frwa onto <[email protected] >>>> > <mailto:[email protected]>> wrote: >>>> > >>>> > Hi Martin >>>> > I got this error now when I did this monit start service1 ? >>>> > Where to add the 'set httpd statement"? >>>> > >>>> > Action start not possible - monit http interface is not enabled, please >>>> > add the 'set httpd' statement ? Should I start using monit start command >>>> > or can I use the existing method to start it? Which the correct one? >>>> > >>>> > On Mon, Nov 9, 2015 at 11:27 PM, Martin Pala <[email protected] >>>> > <mailto:[email protected]>> wrote: >>>> > Hi, >>>> > >>>> > correct syntax is: >>>> > >>>> > monit start service1 >>>> > >>>> > Regards, >>>> > Martin >>>> > >>>> > >>>> > > On 09 Nov 2015, at 16:23, frwa onto <[email protected] >>>> > > <mailto:[email protected]>> wrote: >>>> > > >>>> > > Hi, >>>> > > I have set below in my monit.conf. >>>> > > >>>> > > check process service1 with pidfile /var/run/wrapper.service1.pid >>>> > > start program = "/etc/rc.d/init.d/service1 start" with >>>> > > timeout 60 seconds >>>> > > stop program = "/etc/rc.d/init.d/service1 stop" >>>> > > >>>> > > I tried to start the service in this manner >>>> > > monit service1 start >>>> > > Invalid argument -- service1 (-h will show valid arguments) >>>> > > >>>> > > So should I start using my existing method where I get into my wrapper >>>> > > folder /usr/local/wra1/bin/ then key in ./startDaemon.sh? I would like >>>> > > to know if I am doing the right thing? >>>> > > >>>> > > Thank you. >>>> > > >>>> > > -- >>>> > > 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 >>>> <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 >>> <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 > <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
