Ad Widget

Collapse

Unable to send remotely script to Host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OfficialServerGuy
    Junior Member
    • Jun 2017
    • 6

    #1

    Unable to send remotely script to Host

    Hello,

    I am able to run "df -h" on host but below command is not working.

    HTML Code:
    find / -name 'core.*[[:digit:]]' 2> /dev/null | xargs rm -f > /root/delcores.txt
    Also tried this:

    Code:
    /bin/find / -name 'core.*[[:digit:]]' 2> /dev/null | xargs rm -f > /root/delcores.txt
    Note:- i dont wanna run this script by placing the code on host as shell script.Because i have 100s of server and dont wanna place shell script on each,

    i wanna run script just like "df -h" runs .

    I created the script from Administration --> Script.

    Thank you.
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    what is the error that you get ?
    is this a remote script you want to run or as an Action ?

    Comment

    • OfficialServerGuy
      Junior Member
      • Jun 2017
      • 6

      #3
      Error im getting is "Cannot excute script - Not supported by zabbix agent"
      Im running it from Zabbix Dashboard -- > Administration --> Script
      Attached Files

      Comment

      • batchenr
        Senior Member
        • Sep 2016
        • 440

        #4
        Originally posted by OfficialServerGuy
        Error im getting is "Cannot excute script - Not supported by zabbix agent"
        Im running it from Zabbix Dashboard -- > Administration --> Script

        this is not a script this is a command.
        a script need to look like this :

        /home/zabbix/make_a_call.sh 2>&1

        Comment

        • OfficialServerGuy
          Junior Member
          • Jun 2017
          • 6

          #5
          Hi
          Please read the thread from beginning, im able to run "df -h" without placing any bash script in /home/zabbix/

          but not the second one.
          Attached Files

          Comment

          • batchenr
            Senior Member
            • Sep 2016
            • 440

            #6
            Originally posted by OfficialServerGuy
            Hi
            Please read the thread from beginning, im able to run "df -h" without placing any bash script in /home/zabbix/

            but not the second one.
            sorry you right.
            ok so i tried it myself and it did worked.
            where do you get this message ? when you try to save this script ?
            which zabbix server version do you have ?

            what i did is to set a remote script under Administration -> Scripts
            set it like you did.
            and then went to action and made a trigger to execute this script.
            and in the action log i can see it has executed

            my version is 3.2.6

            do you have in /etc/zabbix/zabbix_agent.conf EnableRemoteCommands=1?

            Comment

            • OfficialServerGuy
              Junior Member
              • Jun 2017
              • 6

              #7
              Okay,

              after saving script successfully from Administration -> Scripts,
              im executing it from Zabbix dashboard when any server comes in front during alert.

              Please check the highlighted portion in screenshot.

              that error im getting when i click on Del Core.

              See. im able to run "df -h" command only because i have enable remote commands from .conf file .

              /etc/zabbix/zabbix_agentd.conf
              EnableRemoteCommands=1
              yes it is there.

              Comment

              • batchenr
                Senior Member
                • Sep 2016
                • 440

                #8
                Originally posted by OfficialServerGuy
                Okay,

                after saving script successfully from Administration -> Scripts,
                im executing it from Zabbix dashboard when any server comes in front during alert.

                Please check the highlighted portion in screenshot.

                that error im getting when i click on Del Core.

                See. im able to run "df -h" command only because i have enable remote commands from .conf file .

                /etc/zabbix/zabbix_agentd.conf
                EnableRemoteCommands=1
                yes it is there.
                ok so i did it again but i used this :

                /usr/bin/find /home//tester/ -name 'core.*' 2> /dev/null | xargs rm -rf

                because with your command it didnt work
                and i didnt get an error but the script didnt worked until i did this :

                chown -R zabbix. /home/tester

                and then the script wored perfectly.

                other issue i can think about is maybe a package that u missing :
                i have this -

                zabbix-web-3.2.6-1.el7.noarch
                zabbix-get-3.2.6-1.el7.x86_64
                zabbix-release-3.2-1.el7.noarch
                zabbix-web-mysql-3.2.6-1.el7.noarch
                zabbix-java-gateway-3.2.6-1.el7.x86_64
                zabbix-sender-3.2.6-1.el7.x86_64
                zabbix-agent-3.2.6-1.el7.x86_64
                zabbix-server-mysql-3.2.6-1.el7.x86_64

                let me know if it helped.

                Comment

                • OfficialServerGuy
                  Junior Member
                  • Jun 2017
                  • 6

                  #9
                  Thanks for efforts , i will update you after following the same.

                  Thanks.

                  Comment

                  Working...