philipcwhite / Monitoring

Monitoring Server and Agents written in Python
Apache License 2.0
8 stars 5 forks source link

install ... services #2

Closed M4D1S0N closed 3 years ago

M4D1S0N commented 3 years ago

Hello, thx for reply.

Installed elementary, did all the install steps and reboot the system.

magent.service and mwserver.service didnt start. startet agent with "sudo systemctl start magent.service" <- this services runs

then tried to start mwserver.service -> error -> failed to start service

image

tried to start unicorn app:app -> error

image

EDIT:

Deleted VM and installed it another time - next clean install ;-) mserver.service is now running, Logon is working =)

Now I try to get the agent to work.....

EDIT2:

image

any ideas?

philipcwhite commented 3 years ago

Try running sudo python3.8 /opt/monitoring/agent/agent.py <-if it creates a sqlite database in the agent directory then it should be working. The agent should run on python3.6 or newer fine. There is no asyncio component like the server uses. The agent will run even if the collector is dead. It just writes the data to the sqlite db and stores it there until it can send. It does require higher permissions to write to the agent directory and to run some of the subprocess commands to collect data.

M4D1S0N commented 3 years ago

Thx for your reply. It's running with python3.8 - thought I tested it before....

The service doesn't start..Error.. I added some lines in magent.service:

image

Now its running fine.

I like your Projekt. Its small and a minimal GUI. All I need. I want to monitor my 14 Windows 2019 Servers. Lets test =)

PS: The WEB-interface....cant connect from an other Client to the Webpage.

philipcwhite commented 3 years ago

Thanks. As for the connecting from another computer to the web interface it may be a IP or port issue. It does work as I have this running on a VPS with my homepage. Try setting to 80 or enabling ssl on 443. I included two self signed certs if you go ssl.

/opt/monitoring/env/bin/gunicorn --bind 0.0.0.0:443 --certfile /opt/monitoring/certificates/localhost.crt --keyfile /opt/monitoring/certificates/localhost.pem run_both:app

or

/opt/monitoring/env/bin/gunicorn --bind 0.0.0.0:80 run_both:app

The agent rules are controlled by the setting.ini file on the agent. I think I put in a default rule to alert at CPU over 1% for 5 minutes so you may want to turn that off. You can also add services to be monitored here. And there is also the ability to run the agent communication via ssl if you want. It has to be configured on the collector and the agent through settings.ini. It should still work but I missed testing it in the last update.