Event Handler - Powershell script not able to import module

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Event Handler - Powershell script not able to import mod

Post by mbellerue »

So here's something interesting. I've got a bunch of temp files in /tmp with the .pwsh extension. These are all from yesterday when I was experimenting with Powershell and Event Handler. I just thought I would add this to the thread in case you have any special restrictions on /tmp
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
scomdco
Posts: 45
Joined: Fri Oct 04, 2019 3:18 pm

Re: Event Handler - Powershell script not able to import mod

Post by scomdco »

I wrote and performed a methodical dissertation on replicating the steps you took, only to find that i was able to successfully import the module from the default, hidden directory that i was not able to do prior. I'm not exactly sure what is the difference this time, i'm assuming maybe i had the directory incorrect, or maybe permissions were not configured as they are now, but it works!!! i appreciate the time you all have taken into assisting me with this, and none of it was wasted as i would not have discovered the solution today if it were not for any of the responses.

For documentation purposes, this is the full command that is working successfully currently for importing the modules. I looked back in the thread and am a little bummed i didn't document how it looked when it was failing prior

Code: Select all

Import-Module -Name /root/.local/share/powershell/Modules/AWS.Tools.Common/3.3.604.0/AWS.Tools.Common.psd1
Import-Module -Name /root/.local/share/powershell/Modules/AWS.Tools.EC2/3.3.604.0/AWS.Tools.EC2.psd1
This thread can be CLOSED :D
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Event Handler - Powershell script not able to import mod

Post by mbellerue »

w00t! Glad you got it working! Closing the thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked