Ad Widget

Collapse

system.sw.packages Cannot obtain package information.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JSERRAHIMA
    Junior Member
    • May 2021
    • 16

    #1

    system.sw.packages Cannot obtain package information.

    Hi,

    I'm trying to unlock this monitor but always retrieve same error "Cannot obtain package information."

    When executing

    Code:
    [root@system ~]# time rpm -qa
    ...
    ...
    ...
    ...
    real 0m1,565s
    user 0m1,460s
    sys 0m0,097s
    Tried setting Timeout=4 on zabbix-agent config and neither change.

    Trying monitor it returns all installed packages

    Code:
    [root@system ~]# /usr/sbin/zabbix_agentd -t system.sw.packages
    system.sw.packages [t|[rpm] GC ........... ]
    May be a SELinux problem? Other monitors does not return any problems like this one.

    Best regards.
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    Recently I've come across the same issue. It also seems to be related to this other topic.
    I'm using Zabbix Server and Agent 6.0.4 with a WSL Ubuntu 20.04.

    When I test the key with "Zabbix Agent2", it shows the correct output. The response takes about 1 second.
    Code:
    $ zabbix_agent2 -t system.sw.packages
    system.sw.packages [s|[dpkg] ......]
    When I try it with "Zabbix Get", it doesn't work.
    Code:
    $ zabbix_get -s localhost -k system.sw.packages
    ZBX_NOTSUPPORTED: Cannot obtain package information.
    I can't figure out what's going on.
    Any idea?

    Comment

    • jerometeano
      Junior Member
      • Sep 2022
      • 7

      #3
      Experiencing the same issue here. It runs on the server but showing this error on the zabbix UI.

      Comment


      • jurgen16
        jurgen16 commented
        Editing a comment
        Same for me.
        Do you have solved this?
    • spookmeoz
      Junior Member
      • Jun 2021
      • 3

      #4
      This is an old thread, but I'm seeing the same issue. Did anyone find a solution?

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #5
        I don't recall in what situation I had this issue , but I just tested it again with a proxy and it worked flawlessly.
        Code:
        $ time zabbix_get -s localhost -k system.sw.packages
        [rpm] (...)
        
        real 0m2.127s
        user 0m0.004s
        sys 0m0.003s
        Maybe the OP issue was with the timeout after all.
        The timeout parameter could be increased for both ends of the Agent and Server/Proxy. Also, the Server/Proxy timeout should be a bit higher then the Agent's timeout.

        Comment

        • JulioQc
          Junior Member
          • Dec 2018
          • 28

          #6
          Originally posted by markfree
          Maybe the OP issue was with the timeout after all.
          The timeout parameter could be increased for both ends of the Agent and Server/Proxy. Also, the Server/Proxy timeout should be a bit higher then the Agent's timeout.
          Running on host directly:

          Code:
          [root@b1henri ~]# zabbix_agentd -t system.sw.packages.get
          system.sw.packages.get zabbix_agentd [1531333]: Warning: Failed to execute command "LC_ALL=C rpm -qa --queryformat '%{NAME},%{VERSION}-%{RELEASE},%{ARCH},%{SIZE},%{BUILDTIME},%{INSTALLT IME}
          '": Timeout while executing a shell script.
          [m|ZBX_NOTSUPPORTED] [Cannot obtain package information.]


          Raised agent timeout from default 3s to 5s (same as my proxy) and command returned expected result. Easy fix!

          Comment


          • jburysom
            jburysom commented
            Editing a comment
            How do you increase the timeout parameter for both ends of the Agent and Server/Proxy. I found the following in the /etc/zabbix/zabbix_agent2.conf file. Did you set the Timeout options or the PluginTimeout option?

            ### Option: Timeout
            # Spend no more than Timeout seconds on processing
            #
            # Mandatory: no
            # Range: 1-30
            # Default:
            # Timeout=3

            or

            ### Option:PluginTimeout
            # Timeout for connections with external plugins.
            #
            # Mandatory: no
            # Range: 1-30
            # Default: <Global timeout>
            # PluginTimeout=

            What option do you set on the server side? Thanks!

          • markfree
            markfree commented
            Editing a comment
            jburysom it is both the agent and server/proxy "Timeout" parameter. Keep the server/proxy "Timeout" slightly higher (1s) than the agent's. Also, it is now possible to set timeouts for individual items.
            Last edited by markfree; 20-07-2024, 01:35.

          • JulioQc
            JulioQc commented
            Editing a comment
            You have to raise the "Option: timeout" across the board; so agent, proxy (if applicable in your setup), server. Simply because as I understand it the server sends the request to the proxy that in turn sends to the agent so therefore the server waits on the proxy which waits on the agent. So setting agent to say 15s timeout will not work if proxy/server has 3s timeout. Makes sense?
        • jurgen16
          Junior Member
          • Jul 2023
          • 11

          #7
          After some tests it work as item when I set SELINUX in permissive state

          Comment

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

            #8
            Originally posted by jurgen16
            After some tests it work as item when I set SELINUX in permissive state
            selinux has its purpose, in permissive mode it does serve that purpose. You need to add additional rules to it, so things would also work when selinux is in full enforce mode...

            Comment


            • jurgen16
              jurgen16 commented
              Editing a comment
              Yes you are right, after some tests I made some semodule rules and now it is working properly.
          • JulioQc
            Junior Member
            • Dec 2018
            • 28

            #9
            Raised the timeout from default 3s to 15s on proxy (or server if no proxy) but also on agent's .conf file and restarted the service. Seems to work now.

            Comment

            Working...