remove usage of global variable
https://github.com/librenms/librenms/pull/3244#issuecomment-210145913