08-23-2024 07:24 AM
Good Morning!
Can someone tell me to proper way of setting the MERAKI_API_KEY environment variable in Linux? I get it set but everytime I reboot my system I loss it.
Thanks in advance!
Ed
Solved! Go to Solution.
08-23-2024 07:49 AM
It needs to be in the environment of the user executing the scripts that need it.
If you want it just for yourself, you could edit your .profile to add...
MERAKI_API_KEY="whatever it is"
export MERAKI_API_KEYIf you will be running the Python scripts from inside a shell script wrapper (for instance if you were using cron to run the script periodically) you can put the same lines in the shell script.
At the linux shell prompt, you can type 'env' to see your environment.
08-23-2024 07:49 AM
It needs to be in the environment of the user executing the scripts that need it.
If you want it just for yourself, you could edit your .profile to add...
MERAKI_API_KEY="whatever it is"
export MERAKI_API_KEYIf you will be running the Python scripts from inside a shell script wrapper (for instance if you were using cron to run the script periodically) you can put the same lines in the shell script.
At the linux shell prompt, you can type 'env' to see your environment.
08-25-2024 01:41 AM
I personally prefer the ".env" method, which stores it in an environment file in your home directory. This is also portable across lots of different environments.
Crap. That article uses referenes to the old Meraki SDK - but the concept is still legit.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide