Ad Widget

Collapse

Empty String From Remote Command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stammer
    Junior Member
    • Dec 2012
    • 18

    #1

    Empty String From Remote Command

    Hi,

    I'm having problems using remote command. The result is a empty string, but if I execute manually the script, it returns data.

    Using zabbix_agentd it returns "OK", But using zabbix_get it returns an empty string:

    In attachmment. I couldn't post code here because of live links/images validation.

    Anyone could help me?
    Attached Files
  • wick
    Member
    • May 2017
    • 57

    #2
    Hi stammer,

    The user Zabbix on your Windows have the permission to launch your script ?

    Comment

    • stammer
      Junior Member
      • Dec 2012
      • 18

      #3
      Originally posted by wick
      Hi stammer,

      The user Zabbix on your Windows have the permission to launch your script ?
      Hi, wick

      Zabbix service use the same user as I have manually executed the commands.

      Comment

      • wick
        Member
        • May 2017
        • 57

        #4
        What do you do to prepare the script ?
        We need to know how you configure your script execution by zabbix agent

        sorry for my bad english

        Comment

        • stammer
          Junior Member
          • Dec 2012
          • 18

          #5
          Hi,

          All of the remote commands are failing. Remote Commands is enabled on zabbix agent configuration.

          As simple ECHO become not supported:

          system.run["echo Teste"]

          Comment

          • wick
            Member
            • May 2017
            • 57

            #6
            In your config file you do something like that for your script ?

            HTML Code:
            https://www.zabbix.com/documentation/3.2/manual/config/items/userparameters
            cause if it's not do you can create a directory next to your agent config file name "zabbix_agentd.d". After in this directory create a config file with

            UserParameter=<key_you_want>,<the_path_of_your_scr ipt>

            After restart your agent

            and normaly it's good

            Comment

            • stammer
              Junior Member
              • Dec 2012
              • 18

              #7
              Using the command "system.run" I don't need to use UserParameter.
              I already have used this script in hundreds o servers, but only this specific server has this problem.

              Comment

              • wick
                Member
                • May 2017
                • 57

                #8
                Problem with the firewall ? I don't know what doing wrong with this server ...

                Comment

                • stammer
                  Junior Member
                  • Dec 2012
                  • 18

                  #9
                  There are many servers behind the firewall.
                  If I run the command manually using zabbix_agentd it returns the correct value.
                  Only zabbix and if I run the command manually using zabbix_get it returns an empty string.

                  Comment

                  • wick
                    Member
                    • May 2017
                    • 57

                    #10
                    I don't know what going wrong maybe you config file ? A commented file ?

                    Can you put your config file on pastebin please

                    HTML Code:
                    https://pastebin.com/
                    if you can't for some reason i can understand so try to put config file of an other server on this server and try again.

                    Comment

                    • stammer
                      Junior Member
                      • Dec 2012
                      • 18

                      #11
                      Hi,

                      Here is the config file:

                      Code:
                      LogFile=C:\Zabbix\log\zabbix_agentd.log
                      EnableRemoteCommands=1
                      LogRemoteCommands=1
                      Server=172.21.0.25,172.21.0.254
                      ServerActive=172.21.0.25
                      StartAgents=0
                      Hostname=SRV-PORSCHE
                      Timeout=30
                      DebugLevel=4

                      Comment

                      • stammer
                        Junior Member
                        • Dec 2012
                        • 18

                        #12
                        Somebody can help?

                        Comment

                        • wick
                          Member
                          • May 2017
                          • 57

                          #13
                          You try to uninstall the agent ? copy and paste an other fonctionnal config file in this server ? or just restart th service ?

                          Comment

                          • stammer
                            Junior Member
                            • Dec 2012
                            • 18

                            #14
                            I already have installed a more recent version of Zabbix.
                            Also I copied the config file from a functional config file.
                            I don't know what I can do more.

                            Comment

                            • wick
                              Member
                              • May 2017
                              • 57

                              #15
                              Try to reinstall .. maybe a bad installation ? or ... i don't know too
                              just restart the service do not function ?

                              Or reinstall windows server ?

                              Comment

                              Working...