Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monit appears to be working on command line but get 404 'There is no service by that name' in web interface [closed]

Tags:

ubuntu

monit

Monit seems to be working, but when I go to the web interface at port :2812 I get

-->:/var/log$ sudo monit -t
Control file syntax OK
-->:/var/log$ sudo monit status
The Monit daemon 5.2.5 uptime: 11m 

System 'system_mydomain.net'
  status                            running
  monitoring status                 monitored
  load average                      [0.00] [0.01] [0.05]
  cpu                               0.0%us 0.0%sy 0.0%wa
  memory usage                      645520 kB [63.4%]
  swap usage                        213128 kB [10.1%]
  data collected                    Wed Feb 15 06:27:26 2012

Any ideas what would cause this?

like image 549
99miles Avatar asked Feb 15 '12 16:02

99miles


People also ask

How do I check my monit status?

The monit configuration can be re-read after installing the PSM by entering the command “monit reload”, or by rebooting the machine. You can obtain the status of the PSM and other important services via the monit web interface at http:// <server ip address>:2812 or on the command line.

What is monit service in Linux?

Monit is a free, open-source process supervision tool for Unix and Linux. With Monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server. Monit is able to do automatic maintenance, repair, and run meaningful causal actions in error situations.

How do I cancel monit service?

Stop, start, and disable apigee-monit As with any service, you can stop and start apigee-monit using the apigee-service command. In addition, apigee-monit supports the unmonitor command, which lets you temporarily stop monitoring components.


2 Answers

I couldn't get this working so that all external IPs could access the web interface.

In the end I used Apache:

<VirtualHost *:80>
    ServerName monit.yourdomain.com
    ProxyPass / http://localhost:2812/
    ProxyPassReverse / http://localhost:2813/
    ProxyPreserveHost On
    <Proxy>
        Order allow,deny
        Allow from all
    </Proxy>
</VirtualHost>

You need the proxy and proxy_http mods enabled for this to work.

like image 130
JonB Avatar answered Sep 28 '22 05:09

JonB


Probably your configuration is SSL enabled but you have not generated the private certificate for HTTPS.

If you do not care about security in your context, open /etc/monit/monitrc and replace the existing httpd section with

set httpd port 2812 and
   allow localhost
   allow admin:test

After a monit deamon restart, you should be able to connect to http://localhost:2812/ with admin user and password test.

To allow access from anywhere, you have to use allow 0.0.0.0/0.0.0.0

Please refer to monit httpd documentation section for full details.

If you want SSL enabled, you will have to generate a SSL self-signed certificate at /etc/certs/monit.pem thanks to the following procedure, for instance.

like image 36
Yves Martin Avatar answered Sep 28 '22 06:09

Yves Martin