Environment variables in nagios script, for passwords etc
Posted: Mon Jan 06, 2020 5:34 pm
As part of our Nagios monitoring we hit various databases, api endpoints, and other resources that require sensitive information to get to, like passwords.
I know you can set up to 32 custom 'user' variables in a resource file, as seen here: http://nagios.manubulon.com/traduction/ ... ource_file
...and this is one way to go about things. However, we're going to want to put our nagios configuration and resource files into a github repository, and don't want that kind of info in there. The way this sort of problem is handled in Node.js and other ecosystems is to store that sensitive info in environment variables and use them in the Node script. Is there a way to do this in Nagios as well, or is there another strategy that's used by the community?
I know you can set up to 32 custom 'user' variables in a resource file, as seen here: http://nagios.manubulon.com/traduction/ ... ource_file
...and this is one way to go about things. However, we're going to want to put our nagios configuration and resource files into a github repository, and don't want that kind of info in there. The way this sort of problem is handled in Node.js and other ecosystems is to store that sensitive info in environment variables and use them in the Node script. Is there a way to do this in Nagios as well, or is there another strategy that's used by the community?