Runtime error: coercing to Unicode: need string or buffer, N

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
satheesh19870819
Posts: 43
Joined: Wed Mar 21, 2018 1:11 pm

Runtime error: coercing to Unicode: need string or buffer, N

Post by satheesh19870819 »

Hello Team,

I am using esxcli 6.5 in centos 7 to monitor ESXi servers . When i run the script inside the nagios server it is giving perfect result .
But at the nagios front end its giving me the following error message

Code: Select all

 Runtime error: coercing to Unicode: need string or buffer, NoneType found 
Nagios version : i am using the maint version https://github.com/NagiosEnterprises/na ... tree/maint
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Runtime error: coercing to Unicode: need string or buffe

Post by cdienger »

When you run it from the command line are you running it as nagios? You can switch the the nagios user with:

su - nagios

If it doesn't work with nagios but it does for another account like root, then that would suggest a permissions issue somewhere. You can also try running the esxcli command with --debug to see if anything more useful is provided.

What does the configuration look like that calls this plugin? Is the command called via another script? Please provide a details and links to the script if the above doesn't help resolve the issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
satheesh19870819
Posts: 43
Joined: Wed Mar 21, 2018 1:11 pm

Re: Runtime error: coercing to Unicode: need string or buffe

Post by satheesh19870819 »

Thank you for helping me here .

1) Am able to run the script as nagios user inside the nagios server and getting perfect output
2) am running a shell script inside that the esxcli is called and the username and password are hardcoded in the shell script . Ip address is passed as argument to the shell script .

Actually i have two commands inside the shell
a)esxcfg-hostops - to get the manufacturer details
b) esxcli - to get the system information
Both output are set for front end display . But only the a) command output shown at the front end and for the b) command output is showing

Code: Select all

"Runtime error: coercing to Unicode: need string or buffer, NoneType found"
am using vmware vsphere cli 6.5
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Runtime error: coercing to Unicode: need string or buffe

Post by cdienger »

Can you provide a link to or a copy of the script along with the configuration used to define the command and check?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked