Splunk supports WMI (Windows Management Interface) data input for agentless access to Windows performance data and event logs. This means you can pull event logs from all the Windows servers and desktops in your environment without having to install anything on those machines.
The Splunk WMI data input can connect to multiple WMI providers and pull data from them. The WMI data input runs as a separate process (splunk-wmi.exe) on the Splunk server. It is configured as a scripted input in $SPLUNK_HOME\etc\system\default\inputs.conf. Do not edit this file.
Note: This feature is only available on the Windows versions of Splunk and is NOT enabled by default. To enable it, add the following line to $SPLUNK_HOME\etc\system\local\inputs.conf:
[script://$SPLUNK_HOME\bin\scripts\splunk-wmi.py] disabled = 0
Important: There is an issue with stopping and restarting Splunk currently affecting users of remote WMI polling. If one or more of your WMI sources is unavailable at the time that you stop Splunk, Splunk will not come back up unless you wait for the splunk-wmi.exe process to exit, or kill it manually. To avoid this issue, do not unnecessarily list non-existent/non-functioning machines in wmi.conf.
Security and remote access considerationsSplunk requires privileged access to index many Windows data sources, including WMI, Event Log, and the registry. This includes both the ability to connect to the box, as well as permissions to read the appropriate data once connected. To access WMI data, Splunk must run as a user with permissions to perform remote WMI connections. This user name must be a member of an Active Directory domain and must have appropriate privileges to query WMI. Both the Splunk server making the query and the target systems being queried must be part of this Active Directory domain.
Note: If you installed Splunk as the LOCAL SYSTEM user, WMI remote authentication will not work; this user has null credentials and Windows servers normally disallow such connections.
There are several things to consider:
Follow these steps to test the configuration of the Splunk server and the remote machine:
1. Log into the machine Splunk runs on as the user Splunk runs as.
2. Click Start -> Run and type wbemtest. The wbemtest application starts.
3. Click Connect and type \\<server>\root\cimv2, replacing <server> with the name of the remote server. Click Connect. If you are unable to connect, there is a problem with the authentication between the machines.
4. If you are able to connect, click Query and type select * from win32_service. Click Apply. After a short wait, you should see a list of running services. If this does not work, then the authentication works, but the user Splunk is running as does not have enough privileges to run that operation.
Look at wmi.conf to see the default values for the WMI input. If you want to make changes to the default values, edit a copy of wmi.conf in $SPLUNK_HOME\etc\system\local\. Only set values for the attributes you want to change for a given type of data input. Refer to How configuration files work for more information about how Splunk uses configuration files.
[settings] initial_backoff = 5 max_backoff = 20 max_retries_at_max_backoff = 2 result_queue_size = 1000 checkpoint_sync_interval = 2 heartbeat_interval = 500 [WMI:AppAndSys] server = foo, bar interval = 10 event_log_file = Application, System, Directory Service disabled = 0 [WMI:LocalSplunkWmiProcess] interval = 5 wql = select * from Win32_PerfFormattedData_PerfProc_Process where Name = "splunk-wmi" disabled = 0
The [settings] stanza specifies runtime parameters. The entire stanza and every parameter within it are optional. If the stanza is missing, Splunk assumes system defaults.
You can specify two types of data input: event log, and raw WQL (WMI query language) The event log input stanza contains the event_log_file parameter, and the WQL input stanza contains wql.
The common parameters for both types are:
WQL-specific parameters:
Event log-specific parameter:
event_log_file: specify a comma-separated list of log files to poll in the event_log_file parameter. File names that include spaces are supported, as shown in the example.
All events received from WMI have the source set to wmi.
The host is identified automatically from the data received.
Comments
Additional notes on configuring remote WMI polling:
You may explicitly configure the domain user to do the WMI polling.
To do this, you need to configure Splunkd & SplunkWeb windows services to log on as the desire user. (Need to restart services after configuration)
Additional notes on testing remote WMI access using wbemtest:
You should select Asynchronous in the Method Invocation Options to test remote WMI access.
Since splunk-wmi.py uses AsyncCall to poll WMI data from the remote servers, the WMI query responses initiated from the remote servers may get blocked by some firewalls (including windows firewall). If it is the case you need to add additional rules to your firewalls to allow the traffic to pass through.
Posted by johnpun on Oct 19 2008, 7:57pm
MichaelE: The WMI scripts will only work on windows since the scripts are calling the WMI service to make the query of the remotes system(s). I've added a note to this page explicitly stating that you need a Splunk instance on Windows to poll this data. remember that you can have a this Windows instance forward the WMI data on to your indexer which can be running on any of the supported operating systems.
Posted by m@ on Oct 10 2008, 9:57am
Where are the scripts for this? I've just updated to 3.3.3 and there are no other .py scripts in $SPLUNKHOME/bin/scripts/ other than echo.sh. The more I read this page the more I 'infer' that this is only for Splunk on Windows. Is this true? Documentation needs to be made more clear on this.
Posted by MichaelE on Oct 10 2008, 9:45am
spencer205: as far as i know, Splunk does not support this capability yet. if this is something you'd like to see in a future release, you're welcome to email support@splunk.com with an enhancement request. thanks!
Posted by sophy on Sep 16 2008, 4:49pm
How do you configure the user name and password to use when connecting? WMI can make connections using alternative credentials then the ones that the current process is running as, so it seems plausible to me that a stanza should allow one to pass in a user name and password parameter to use when connecting. For example, something like this:
[WMI:Foobar]
server = 192.168.0.2
interval = 10
event_log_file = Application
username = johnd
password = changeme
disabled = 0
Posted by spencer205 on Sep 16 2008, 4:16pm