Export and import Alert Rules

We looking on a way to perform a Alert Rule set Export of all the custom rules that is created.

The aim is to have the Rules set ready for new deployments of LibreNMS with our going and manually recreating each rule when importing the Rules.

This should be possible via SQL statements.

Any suggestions what to run in SQL to get information and what the command will be needed to import

Maybe, it’s as easy as using the MySQL Workbench Table Data Export Wizard and import in the new LibreNMS instance.

If a more precise approach in preferred, handcrafted insert statements are the way to go.

I would recommend basic and up MySQL/MariaDB skills for this and backing up the DB before any manual manipulation.

Thanks, tried it and can not connect to the database with the the software

The connection credentials should be found in /opt/librenms/config/database.php if it’s a DB on the LibreNMS host and the DB isn’t listening on external ports, you can tell MySQL Workbench to first connect via SSH to the LibreNMS server before connecting to the DB.