Ad Widget

Collapse

zabbix_get system.uptime works but system.run doesn't

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jars99
    Junior Member
    • Jun 2019
    • 4

    #1

    zabbix_get system.uptime works but system.run doesn't

    I'm relatively new to zabbix, so go easy on me!

    I'm running zabbix server 3.2.11 on CentOS 7.

    I'm trying to run a zabbix_get command against a Windows system in our sox environment. When I do a zabbix_get with the system.uptime key, I get the result no problem. When I run something like system.run['dir'], it returns quickly with no output. I'm assuming it's a firewall blocking the returning traffic either on the box or the load balancer, but I don't understand why the agent seems to be working fine, but not a system.run. Do they use different ports?

    Because it's in sox, it a little difficult for me to get on the box to troubleshoot there. I'm trying to get more information about what to look for before I get permission to remote into the box. Note that the agent should be configured the same as it is everywhere else in our environment, where both kinds of zabbix_get commands work fine.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    If you use system.run[], you need to enable Zabbix agent configuration to enable remote command execution. By default, remote command execution is disabled, as it may cause security problems such as unexpected commands.
    If you want to be able to execute remote commands, try changing the EnableRemoteCommands value to 1 in zabbix_agentd.conf and restarting the Zabbix agent service.

    Please check the comments field of system.run[] in the manual.
    Last edited by Atsushi; 11-06-2019, 12:12.

    Comment

    • jars99
      Junior Member
      • Jun 2019
      • 4

      #3
      Remote commands are enabled. I run them on our other systems all the time, and we use the same config everywhere. I'm pretty sure this is a firewall issue. I'm wondering if remote commands uses a different port or something.

      Comment

      • jars99
        Junior Member
        • Jun 2019
        • 4

        #4
        I've found another instance where this is occurring. This one is not in sox, so I have full access to the box. I've tried restarting the agent, and it's still not working. I don't see anything signifying a problem in the log. The windows firewall is off. The LoadBalancer is allowing all outbound traffic, and allows port 10050 inbound traffic from my subnet. What else should I check?

        Comment

        • zabbixfk
          Senior Member
          • Jun 2013
          • 256

          #5
          Can you try checking the agent log (increase debug log level to max ) simultaneously when the system.run command fired? Other option is to run packet trace ( wireshark/tcpdump ) on the windows host to see what traffic coming in both system.run and zabbix_agent system.uptime cases.

          Comment

          • jars99
            Junior Member
            • Jun 2019
            • 4

            #6
            Here's what level 5 debug log looks like when I run a 'dir' command:
            5304:20190617:103752.191 Requested [system.run[dir]]
            5304:20190617:103752.191 Executing command 'dir'
            5304:20190617:103752.241 EXECUTE_STR() command:'dir' len:0 cmd_result:''
            5304:20190617:103752.241 Sending back []

            Comment

            • zabbixfk
              Senior Member
              • Jun 2013
              • 256

              #7
              Strange. It should return some output or error.
              Are you sure the user who is running as the agent have enough permissions set in windows?
              And firewall is off ? ( I had similar issues and this firewall was blocking though i whitelisted ports 10050 & 10051 tcp/udp both inbound/outbound - try this).
              Run tcpdump or wireshark on windows when you fire system.run on server.

              Ok worst case , do a clean wipe and re install agent on windows instance

              Comment

              Working...