### Run Nagstamon locally Source: https://github.com/henriwahl/nagstamon/blob/master/AGENTS.md Starts the application from the project root. Requires a display environment; use --help to check environment. ```bash python nagstamon.py ``` -------------------------------- ### Get specific alert with curl Source: https://github.com/henriwahl/nagstamon/blob/master/docs/LibreNMS-Integration-README.md Fetches a single alert by its ID from the LibreNMS API. ```bash curl -H 'X-Auth-Token: YOUR_TOKEN' \ https://librenms.example.com/api/v0/alerts/1 ``` -------------------------------- ### Test server module import with python -c Source: https://github.com/henriwahl/nagstamon/blob/master/AGENTS.md Use this command to verify that a server module imports without errors. Replace 'YourServer' with the actual server module name. ```bash python -c "import Nagstamon.servers.YourServer; print('OK')" ``` -------------------------------- ### Test LibreNMS API with curl Source: https://github.com/henriwahl/nagstamon/blob/master/docs/LibreNMS-Integration-README.md Use this curl command to verify your API token and connectivity. Replace YOUR_TOKEN and the URL with your actual credentials and server address. ```bash curl -H 'X-Auth-Token: YOUR_TOKEN' https://librenms.example.com/api/v0/alerts ``` -------------------------------- ### Run tests with pytest Source: https://github.com/henriwahl/nagstamon/blob/master/AGENTS.md Use this command to run the test suite. Tests cover non-GUI modules via full import, GUI modules via syntax-only compilation, and vendored Xlib syntax checks. ```bash python -m pytest tests/ ``` -------------------------------- ### List all alerts with curl Source: https://github.com/henriwahl/nagstamon/blob/master/docs/LibreNMS-Integration-README.md Retrieves all alerts from the LibreNMS API. Requires a valid API token. ```bash curl -H 'X-Auth-Token: YOUR_TOKEN' \ https://librenms.example.com/api/v0/alerts ``` -------------------------------- ### Run smoke tests Source: https://github.com/henriwahl/nagstamon/blob/master/AGENTS.md Executes the smoke test suite to verify server status parsing changes. ```bash python -m pytest tests/test_smoke.py ``` -------------------------------- ### Acknowledge alert with curl Source: https://github.com/henriwahl/nagstamon/blob/master/docs/LibreNMS-Integration-README.md Acknowledges an alert by sending a PUT request with a JSON note. Requires a valid API token and Content-Type header. ```bash curl -X PUT \ -H 'X-Auth-Token: YOUR_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"note": "Working on it"}' \ https://librenms.example.com/api/v0/alerts/1 ```