"ImportError: No module named psutil" when using ncpa

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

"ImportError: No module named psutil" when using ncpa

Post by sacom01 »

hi,
i write a plugin using psutil function for checking cpu. when i run this plugin on client server it's work fine.
but when i use ncpa for checking it from Nagios XI server, facing to error "ImportError: No module named psutil"
(psutil already exist on client server).
pls donate me advices for this.
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: "ImportError: No module named psutil" when using ncpa

Post by benjaminsmith »

Hi,

When you are testing the plugin locally you are logged in as root, however, this will be run as the nagios account when running this from XI. Try logging in as the nagios user account and testing this once. Please post any error output to the thread.

Code: Select all

su - nagios
./cpu_check.py -w 10 -c 20
Also, please share the plugin script and I can try to replicate this on my tet system. Thanks! Benjamin

Reference
NCPA custom plugins scripts and configuration
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!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: "ImportError: No module named psutil" when using ncpa

Post by sacom01 »

hi ben,
we found the root cause and fixed it.
need install psutil for python2 beside psutil for python3
pls close the topic
thanks
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: "ImportError: No module named psutil" when using ncpa

Post by benjaminsmith »

HI sacom01,

Great! Glad to hear you got it working.

We'll go ahead and mark this as resolved.
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