check_esxi_hardware.py just doesn't want to work

This forum was archived to /woltlab and is now in read-only mode.
  • Peace, unlike the command line, what i define in nagios produces:

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • If I get it correct the plugin call on the command line retrieves a valid result, the call from Nagios is erroneous. You had to change the script header.


    It sounds as if the user environment is different from the process environment meaning the PATH/LD_LIBRARY_PATH/... variable of the user contains entries to access python without changing the script. I'd investigate in that direction.

  • thank you for the valuable advice, it made me research further and after i duckducked, i made the following change in the script:


    Code
    1. #!/usr/bin/env python2.7


    and then i clicked the service to schedule a check and that is where i discovered the full blown error:



    so i duckducked again on how to change the PYTHON_EGG_CACHE environment and i made the following addition to the script:

    (credits to https://stackoverflow.com/ques…vironment-variable-on-mac)

    import os

    os.environ['PYTHON_EGG_CACHE'] = '/home/nagios/.cache/Python-Eggs'


    and get ready, I am extremely glad!

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • Why guess? it is like believing a weather forecast! My system is gentoo and sometime ago, they released the new pnp package for gentoo and i installed it, and since then, nagios reports that it's status is crashed. I am unable to stop, start or restart nagios. The weird thing nagios still works and now to change configuration i have to reboot. I think that might have to be the reason.

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • /usr/local/nagios/ is not the installation path.

    i chowned nagios to /etc/nagios, some belonged to root.

    and


    the problem is that /var/run does not contain a nagios file.

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • i created a directory nagios in /run and chowned it nagios:nagios and rebooted. surprise, surprise, the directory was deleted after the reboot. Next, I just recreated the negios directory with default ownership and it still got deleted after reboot.

    Worth mentioning, the pnp directory changed from /var/nagios/perfdata to /var/lib/pnp

    perhaps this is causing the crash and i must reconfigure pnp?

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • Please take at the image related to the mode you configured. As you can see Nagios writes the performance data to a directory holding temporary files. process_perfdata.pl processes these files and calls rrdtool to update the xml-/rrd-files so both folders you mentioned might be used.

  • my pnp is installed in bulk mode. i reconfigured the pathes, and host-perfdata and service-perfdata were recreated in /var/lib/pnp/var/

    i also chowned the new installation paths to nagios and even chowned process_perfdata.pl and rebooted, this time nagios did not start with boot. i started it and it did, tried to restarted and that failed and the status reported again as crashed. i checked the masked packages and an old pnp4nagios version was there. I removed that, uninstalled pnp, restarted, but nagios is still crashed. so I reemerged (installed) it and rebooted again. tried to to recreate /run/nagios but same deal.

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

    The post was edited 1 time, last by Majed ().

  • Well a magician must know the system from what command is used to update the system, like yast, yum, apt, ...

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • I'm not sure you understood what linux is this. anyway:

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.

  • We'll see in future posts if you will guess or not.

    Someone might be interested in how to resolve this.

    the problem is solved by editing the init.d script pid to point to that of nagios.cfg.

    Knock and it shall be opened, seek and you shall find, cry and you shall be comforted.