Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

  • WMI Module Issues

    Posted by FIASIT on July 26, 2017 at 08:47

    I am having an issue with the WMI modules.
    I have a server setup and added some WMI modules to some agents (is that the right terminology??) they are always coming up as non-initialised.
    I have read through the forum and seem all the other posts regarding the same issue but none of the solutions I have found seems to work.

    For example, I have added the windows defender service state module 
    in the module component window, I have added the username DOMAINUser and the password, the wmi query is select state from Win32_Service where name = ‘WinDefend’
    Module state is non-initialised

    I have tried running the command from the cli of the server
    wmic -U “domenusername”%”password” //IPADDRESS “select state from Win32_Service where name = ‘WinDefender'”
    and it returns the following which appears to be correct
    CLASS: Win32_Service
    Name| State
    WinDefend| Running

    I have changed the verbosity of the server log to 10 and I see the log for the wmi module collection as follows

    2017-07-26 11:57:31 pandorafms [V9] Executing AM # 42 WMI command ‘wmic -U “DOMAINUsername”%”password” //auto “select state from Win32_Service where name = ‘WinDefend'”‘
    2017-07-26 11:57:54 pandorafms [V10] Updating module WindowsDefender_status (ID 42) on error.

    can anyone explain what the on error is?? 
    everything looks ok and the command works from the cli so why does it not work automatically?

    The other thing I have checked in the server config is that wmiserver is set to 1

    Any assistance would be greatly appreciated.

    FIASIT replied 7 years, 3 months ago 4 Members · 25 Replies
  • 25 Replies
  • luis.gomez

    Member
    July 26, 2017 at 16:50
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello FIASIT,

    Checks the module type based on the data received by the WMI query execution.

    Kind regards,
    Luis.

  • FIASIT

    Member
    July 27, 2017 at 04:09
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello FIASIT,

    Checks the module type based on the data received by the WMI query execution.

    Kind regards,
    Luis.

    the module type is set to Generic boolean (generic_proc) It does not appear to be able to be changed.
    I set this module up using the built-in list in add modules under the module template section.

  • luis.gomez

    Member
    July 27, 2017 at 18:10
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello FIASIT,

    You can create a new module, type Generic String.

    Kind regards,
    Luis.

  • FIASIT

    Member
    July 28, 2017 at 04:27
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello FIASIT,

    You can create a new module, type Generic String.

    Kind regards,
    Luis.

    I have created a new module as suggested but still getting an error in the log

    [V10] Updating module WMI-Service(WindowsDefender_statu) (ID 45) on error.

  • vic

    Administrator
    July 31, 2017 at 17:56
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi FIASIT,

    Can you say me the version of your Pandora server?
    For now you can add a module in the configuration file of your Windows Agent.

    module_begin
    module_name Windows Defender
    module_type generic_data_string
    module_wmiquery SELECT * FROM Win32_Service WHERE Name="WinDefend"
    module_wmicolumn State
    module_str_critical Stopped
    module_end

    Best regards,

    vic.

  • FIASIT

    Member
    August 1, 2017 at 03:47
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi FIASIT,

    Can you say me the version of your Pandora server?
    For now you can add a module in the configuration file of your Windows Agent.

    module_begin
    module_name Windows Defender
    module_type generic_data_string
    module_wmiquery SELECT * FROM Win32_Service WHERE Name="WinDefend"
    module_wmicolumn State
    module_str_critical Stopped
    module_end

    Best regards,

    vic.

    Thanks for getting back to us.
    I have added the module in the agent config file and it is now showing up in the Pandora console.

    The version of Pandora we are running 7.0NG.707 (P) 170711

    Thanks

  • vic

    Administrator
    August 1, 2017 at 11:11
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi FIASIT,

    The version 707 have a bug that not allow adding WMI modules inside the same agent of the query, on the last version the problem is solved.
    Thanks for reporting.

    vic.

  • FIASIT

    Member
    August 9, 2017 at 10:29
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thanks will give the new version a try.

  • FIASIT

    Member
    August 16, 2017 at 11:29
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi again,
    we have built a new server running:
    Pandora FMS Build PC170810
    Pandora FMS Version v7.0NG.710

    We are still having issues when we add wmi modules. I have again tested from the console and the wmic query runs fine and give the result we are expecting but the module always shows as not initialized in the web console and the server log shows the same error message as the previous version we were running.

    Any advice?

  • dkoel

    Member
    August 16, 2017 at 16:31
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Same problem here.

  • vic

    Administrator
    August 16, 2017 at 19:18
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi FIASIT, dkoel,

    I’m trying to replicate the problem, but I can’t. I add all modules with the WMI wizard to Windows Agent, and all is initialised.
    You need use a user with admin privileges and this user have permissions to make WMI querys.
    A guide: https://technet.microsoft.com/en-us/library/cc771551(v=ws.11).aspx

    Best regards,

    vic.

  • dkoel

    Member
    August 16, 2017 at 23:42
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Vic,

    Thanks for the reply. Here’s some extra info.

    Here’s the part from my pandora_server.log:

    2017-08-16 21:31:12 localhost.localdomain [V9] Executing AM # 17 WMI command 'wmic -U "[email protected]"%"P@ssw0rd" //192.168.100.1 "SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID = 'C:'"'
    2017-08-16 21:31:12 localhost.localdomain [V10] Updating module Free disk (ID 17) on error.

    When I execute the command from the terminal, I get the correct response:

    [root@localhost ~]# wmic -U "[email protected]"%"P@ssw0rd" //192.168.100.1 "SELECT FreeSpace FROM Win32_LogicalDisk WHERE DeviceID = 'C:'"
    CLASS: Win32_LogicalDisk
    DeviceID|FreeSpace
    C:|120187482112
    [root@localhost ~]#
    

    I’ve reinstalled the server from CentOS Appliance ISO (PandoraFMS7.0NG.709.x86_64.iso) and from the VMware OVF. I’ve updated both to the version below. The CentOS Appliance ISO worked well with the “yum update” to v7.0NG.710, but the VMware OVF bricked my mysql database connection (that’s another issue): 

    Pandora FMS Build
    PC170810
    Pandora FMS Version
    v7.0NG.710

    Don’t know if you can replicate the issue with this information.

    Edit 1: It seems to have something to do with the “Create a new WMI server module” functionality. When I use this method, the module stays uninitialized. When I use the WMI explorer and add the module, all is working fine.

    Edit 2: In my other environment both methods stay uninitialized and a manual wmic from console works fine.

  • vic

    Administrator
    August 17, 2017 at 12:36
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi dkoel,

    Are you putting the module type correctly?

    Best regards,

    vic.

  • dkoel

    Member
    August 17, 2017 at 12:53
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Vic,

    I’ve not created my own modules yet. These are the default that are installed.

    Saludos

  • FIASIT

    Member
    August 18, 2017 at 03:21
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi Vic,

    I’ve not created my own modules yet. These are the default that are installed.

    Saludos

    This is the same for myself I have only used the built in WMI modules and have not created my own.

    As for a user with the correct permissions, I have tried with the domain admin and the local machine admin and the same result works in the console but not in the module.

  • vic

    Administrator
    August 18, 2017 at 12:27
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi all,

    I see that you have a problem in configuring the module, delete it and create another with the same data manually. In case the module is still not started, it will be due to the lack of permissions.

    Best regards,

    vic.

  • FIASIT

    Member
    August 21, 2017 at 03:28
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi all,

    I see that you have a problem in configuring the module, delete it and create another with the same data manually. In case the module is still not started, it will be due to the lack of permissions.

    Best regards,

    vic.

    So, I have gone to the module configuration of one of my servers 
    created a new wmi server module
    Selected Manual setup rather than one of the predefined modules
    filled in all the relevant information
    tested the wmi query from the console (it works)

    waited for the server to update and still, the module is saying non-initialized

    2017-08-21 07:18:36 pandorafms.localdomain [V9] Executing AM # 162 WMI command 'wmic -U "SERVERNAMEadministrator"%"PASSWORD" //SERVERNAME "select ConnectionAttemptsPersec from Win32_PerfRawData_W3SVC_WebService"'
    2017-08-21 07:18:36 pandorafms.localdomain [V10] Updating module IIS ConnectionAttemptsPersec(manual) (ID 162) on error.
  • dkoel

    Member
    August 22, 2017 at 10:40
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi all,

    I see that you have a problem in configuring the module, delete it and create another with the same data manually. In case the module is still not started, it will be due to the lack of permissions.

    Best regards,

    vic.

    Hi Vic,
    Thank you for your reply’s and suggestions.
    I have a problem with the “Lack of permissions”. Could you please explain why it would be a lack of permissions when we (FIASIT and I) can execute the command from the console and not from the webinterface?
    The same user is used to execute the command. Correct? The WMI-user is a domain admin. The webconsole-user is Admin. Where would the lack of permissions be?
    Regards.

  • vic

    Administrator
    August 22, 2017 at 11:51
    1534 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi FIASIT, dkoel,

    I am doing tests with different versions of pandora and all the modules are started.
    Try this configuration and check the data type and the value returned by the query.

    It should look like this:

    Best regards,

    vic.

  • dkoel

    Member
    August 22, 2017 at 13:02
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Sorry Vic,

    Same response. Again I’ve added the response from the console’s and logs.

    Regards.

Page 1 of 2