Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd script #7

Open
thetravellor opened this issue Apr 2, 2023 · 1 comment
Open

systemd script #7

thetravellor opened this issue Apr 2, 2023 · 1 comment

Comments

@thetravellor
Copy link

thetravellor commented Apr 2, 2023

A suggested enhancement:

stephen@librenms:~$ cat rrdrest.service

Description=Uvicorn systemd service.
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
ExecStart=/usr/local/bin/uvicorn rrdrest:rrd_rest --host "0.0.0.0" --port 9000
User=stephen
Group=stephen
RuntimeDirectory=/var/run/uvicorn
WorkingDirectory=/home/stephen/RRDReST
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
RestartSec=1
Restart=always

[Install]
WantedBy=multi-user.target

stephen@librenms:~$

`stephen@librenms:~$ sudo systemctl status rrdrest
● rrdrest.service
Loaded: loaded (/lib/systemd/system/rrdrest.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-04-02 11:52:32 AEST; 2min 2s ago
Main PID: 29832 (uvicorn)
Tasks: 5 (limit: 4636)
Memory: 11.8M
CGroup: /system.slice/rrdrest.service
└─29832 /usr/bin/python3 /usr/local/bin/uvicorn rrdrest:rrd_rest --host 0.0.0.0 --port 9000

Apr 02 11:52:32 librenms systemd[1]: Started rrdrest.service.
Apr 02 11:52:32 librenms uvicorn[29832]: INFO: Started server process [29832]
Apr 02 11:52:32 librenms uvicorn[29832]: INFO: Waiting for application startup.
Apr 02 11:52:32 librenms uvicorn[29832]: INFO: Application startup complete.
Apr 02 11:52:32 librenms uvicorn[29832]: INFO: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)`

Note that I used the git directory as the working directory as uvicorn cant find the RRD module unless the CWD is the git directory. Perhaps some instructions on installing the module might help, to noobs like me :)

@thetravellor
Copy link
Author

Hi, can you post the screenshots or config that used be on reddit here: https://www.reddit.com/r/LibreNMS/comments/ojc8cc/how_to_almost_natively_integrate_librenms_and/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant