Ad Widget

Collapse

Why zabbix is looking for a bad path to execute my external script.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clayzes
    Junior Member
    • May 2022
    • 29

    #1

    Why zabbix is looking for a bad path to execute my external script.

    Hello,
    I'm trying to monitor cpu temperature using https://github.com/blind-oracle/zabbix-sensors

    So I did everything but in the ui I have the error

    Click image for larger version

Name:	image.png
Views:	272
Size:	14.4 KB
ID:	480676

    Click image for larger version

Name:	image.png
Views:	224
Size:	4.8 KB
ID:	480677​my sensors.conf

    So why is zabbix trying to use /externalscripts ?

    Thank you for your help
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    I suspect you have somekind of misconfiguration in your item. Can you show item config screenshot?
    Externalscripts parameter exists only in Server/proxy config, so maybe your item type is wrong? "External check" instead of "zabbix agent" ?

    Comment

    • Clayzes
      Junior Member
      • May 2022
      • 29

      #3
      Hello,
      Sorry for delay Click image for larger version

Name:	image.png
Views:	155
Size:	67.1 KB
ID:	480916

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Not the same item, your first pic shows an items with a name containing "voltage" or "disco.."... Nothing like that on your last pic... And dependent item will not execute any script ...

        Comment

        • Clayzes
          Junior Member
          • May 2022
          • 29

          #5
          Click image for larger version

Name:	image.png
Views:	203
Size:	16.4 KB
ID:	480984

          Item prototypes: Click image for larger version

Name:	image.png
Views:	184
Size:	17.3 KB
ID:	480985

          Sensors Json item

          Click image for larger version

Name:	image.png
Views:	141
Size:	50.9 KB
ID:	480986

          from template_sensors
          Click image for larger version

Name:	image.png
Views:	146
Size:	49.3 KB
ID:	480987

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            So here you are, as I predicted... you are using "external check" type of item. This is something, that is executed on server/proxy and looked up from that /usr/lib/zabbix/externalscripts directory by default...
            If you define a user parameter, then you need to use "Zabbix agent" or "Zabbix agent (active)" as userparameters are executed by agent. external check is not userparameter...
            Or move that sensors.py script to /usr/lib/zabbix/externalscripts directory...

            Comment

            • Clayzes
              Junior Member
              • May 2022
              • 29

              #7
              Same error even with the script on the right directory and external check ON.
              Click image for larger version

Name:	image.png
Views:	142
Size:	21.2 KB
ID:	481019
              Click image for larger version

Name:	image.png
Views:	139
Size:	19.3 KB
ID:	481020
              Click image for larger version

Name:	image.png
Views:	138
Size:	12.7 KB
ID:	481021
              Click image for larger version

Name:	image.png
Views:	133
Size:	41.2 KB
ID:	481022

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #8
                Verify script access rights... "namei -mo /usr/lib/zabbix/externalscripts/sensors" . It has to be accessible by user "zabbix"

                Comment

                • Clayzes
                  Junior Member
                  • May 2022
                  • 29

                  #9
                  Click image for larger version

Name:	image.png
Views:	138
Size:	22.3 KB
ID:	481082

                  Yes it's accessible by Zabbix , I tried to sudo -u as Zabbix to execute the script and it worked

                  Comment


                  • tim.mooney
                    tim.mooney commented
                    Editing a comment
                    I'm late to this party, but I don't understand why you're so intent on trying to use this as an "External check" item type.

                    Perhaps you know something about those scripts that I do not, but based upon the documentation in the github repo you linked, those scripts work by accessing files in the sys pseudo filesystem. If that is correct, then the "sensors" script would need to be run on the host that you want to monitor. If you run it as an "External check" from a proxy, you're going to get the sensors for the proxy, not for any system that reports to the proxy.

                    There *are* ways to get sensor data remotely (via IPMI or some other lights-out management protocol like Dell's iDRAC), but at least based upon the documentation, that is not how "sensors" works.
                • Clayzes
                  Junior Member
                  • May 2022
                  • 29

                  #10
                  Hello,

                  The "External check" item is set from the template on the repo , I did not set it.
                  Which item type do you think I should use here ?

                  Comment

                  • cyber
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Dec 2006
                    • 4807

                    #11
                    I just downloaded and installed it on my test zabbix... this installs 1 item and 4 discoveries. And that one item IS of type "Zabbix agent". Definitely not "external check". And it uses Userparameter in agent. which is exactly as tim.mooney mentioned... So yes.. change it to "Zabbix agent" (or "active"), add userparameter to agent config and enjoy those sensors from that host...

                    That external check threw me off a lot.. Should have checked right away by downloading..

                    Comment


                    • tim.mooney
                      tim.mooney commented
                      Editing a comment
                      You diagnosed the problem correctly on your first response. It would have taken me a lot longer to figure out that it was the item type.
                  • Clayzes
                    Junior Member
                    • May 2022
                    • 29

                    #12
                    oh ok , Im gonna take a look , thank you

                    Comment

                    Working...