Ad Widget

Collapse

APC-ScrapConnect PHP Permission Denied

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bobcatjohn
    Junior Member
    • Oct 2023
    • 3

    #1

    APC-ScrapConnect PHP Permission Denied

    I'm a Noob to Ubnuntu 22, Zabbix 6.4, PHP 8.1 so please be gentle!

    I found APC-ScrapConnect.php. (https://www.itsbalto.com/en/posts/za...-smartconnect/)
    I have copied it to /usr/lib/zabbix/externalscripts. I have tried various CHMOD CHOWN commands but get this error:
    • /usr/lib/zabbix/externalscripts/APC-ScrapConnect.php: [13] Permission denied
    • I have verified that PHP and the Curl extension are installed
    • I've set the owner of externalscripts to zabbix:zabbix
    Any advice is appreciated.
  • Answer selected by markfree at 25-04-2024, 04:35.
    bobcatjohn
    Junior Member
    • Oct 2023
    • 3

    I got this working with the help of someone on Reddit. They created a fork of the script and posted detailed directions here https://github.com/ingramcomputers/zabbix/tree/main/APC. The script is now working as expected. Thanks for your help.

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #2
      Originally posted by bobcatjohn
      I'm a Noob to Ubnuntu 22, Zabbix 6.4, PHP 8.1 so please be gentle!
      I'm amazed that so many users ask for kindness when posting questions in forums like this. That should be the standard for any response. Unfortunately, in some places we feel the need to ask for kindness.
      On the other hand, the Zabbix forum is one of the best communities I know.


      As for your question, have you looked at the Zabbix Integrations? There are some templates for common APC models that use SNMP.

      As for external checks,

      The command will be executed as the user Zabbix server runs as, so any access permissions or environment variables should be handled in a wrapper script, if necessary, and permissions on the command should allow that user to execute it. Only commands in the specified directory are available for execution.
      Check your Zabbix Server configuration for the ExternalScripts variable. For example, mine is set to "/usr/lib/zabbix/externalscripts".
      Code:
      $ grep 'ExternalScripts' /etc/zabbix/zabbix_server.conf
      ### Option: ExternalScripts
      # ExternalScripts=/usr/lib/zabbix/externalscripts
      Then, check your script permissions.
      Code:
      $ ls -lah /usr/lib/zabbix/externalscripts/APC-ScrapConnect.php

      Comment

      • bobcatjohn
        Junior Member
        • Oct 2023
        • 3

        #3
        Thanks for the response.

        The particular APC units I am trying to monitor only have the Smart Connection, so you can't directly query them for SNMP values. The script I found grabs the data from the Smartconnect APC website.
        My external scripts are pointing at the same directory
        My permissions are:
        -rwxrwxrwx 1 root root 21K Apr 11 15:25 /usr/lib/zabbix/externalscripts/APC-ScrapConnect.php

        Is that correct? I am a bit of a noob when it comes to Ubuntu/Zabbix. If it is not correct then what is the command to fix it?

        Comment

        • bobcatjohn
          Junior Member
          • Oct 2023
          • 3

          #4
          I got this working with the help of someone on Reddit. They created a fork of the script and posted detailed directions here https://github.com/ingramcomputers/zabbix/tree/main/APC. The script is now working as expected. Thanks for your help.

          Comment

          Working...