From PipoCanaja, 1 Year ago, written in Plain Text.
Embed
  1. librenms@host:~$ ./scripts/test-template.php  -d
  2. Usage:
  3.     -t Is the template ID.
  4.     -h Is the device ID or hostname
  5.     -r Is the rule ID
  6.     -p Is the transport name (optional)
  7.     -s Is the alert state <0> (optional - defaults to current state.)
  8.        0 = ok, 1 = alert, 2 = acknowledged, 3 = got worse, 4 = got better
  9.     -d Debug
  10.    
  11. Example:
  12. ./scripts/test-template.php -t 10 -d -h localhost -r 2 -p mail
  13.  
  14.  
  15.  
  16. librenms@host:~$ ./scripts/test-template.php  -t 6 -r 14 -h 37 -d
  17. SQL[SELECT alert_log.id,alert_log.rule_id,alert_log.device_id,alert_log.state,alert_log.details,alert_log.time_logged,alert_rules.rule,alert_rules.severity,alert_rules.extra,alert_rules.name FROM alert_log,alert_rules WHERE alert_log.rule_id = alert_rules.id && alert_log.device_id = '37' && alert_log.rule_id = '14' && alert_rules.disabled = 0 ORDER BY alert_log.id DESC LIMIT 1]
  18. SQL[SELECT hostname, sysName, sysDescr, sysContact, os, type, ip, hardware, version, location, purpose, notes, uptime FROM devices WHERE device_id = '37']
  19. SQL[SELECT * FROM devices_attribs WHERE `device_id` = '37']
  20.  
  21. Fatal error: Uncaught Error: Call to a member function connection() on null in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1058
  22. Stack trace:
  23. #0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1024): Illuminate\Database\Eloquent\Model::resolveConnection(NULL)
  24. #1 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(859): Illuminate\Database\Eloquent\Model->getConnection()
  25. #2 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(818): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
  26. #3 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(802): Illuminate\Database\Eloquent\Model->newQueryWithoutScopes()
  27. #4 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1374): Illuminate\Database\Eloquent\Model->newQuery()
  28. #5 /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1386): Illuminate\Database\Eloquent\Mod in /opt/librenms/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 1058