Is there something like WMI for Linux?

2019-01-22 08:51发布

问题:

I like the whole WMI concept, and I could really make use of it under Linux (in some scripts). Is there something like that for Linux systems?

回答1:

Not really. Are you using WMI to get system parameters, or to query processes, or to change configuration, or monitor for system events, or what?

The kernel exposes a lot of information and tunable knobs via the /proc and /sys filesystems. No query language, just a organized hierarchy of directories and files. Some of these files are read-only, read-write, or write-only; some of them are pollable.

Some services may have custom clients to query and update configuration on the fly -- chrony's chronyc comes to mind, but even the very most basic init has initctl. Newer services like HAL can be introspected and manipulated over D-Bus.



回答2:

Windows Management Instrumentation (WMI) is Microsoft's implementation of the WBEM (Web Based Enterprise Management) standard from the Distributed Management Task Force. These standards are available and used in several flavors of *nix systems. Just as an example, here is a SourceForge project that enables WBEM on Linux systems. There is a standard called CIM (Common Information Model) which is described by the DTMF as follows:

CIM provides a common definition of management information for systems, networks, applications and services, and allows for vendor extensions. CIM's common definitions enable vendors to exchange semantically rich management information between systems throughout the network.



回答3:

OpenLMI seems to be designed for exactly that purpose... It provides instrumentation to monitor and control Linux-based servers.

There is also WBEM agents for GNU/Linux (like OpenPegasus).

It actually seems that OpenLMI uses Pegasus as the external interface.



回答4:

Take a look at the /proc interfaces. You can get a lot of system information there. There are also many excellent utilities for gathering system information. The sysstat packages are always one of the first things I install these days.

Edit: You can always query SNMP as well. There is a lot of information exposed by default.



回答5:

Maybe it could be helpful for you. Have a look at this post: http://www.aldeid.com/wiki/Wmic-linux



回答6:

I beg to differ, but YES, there is. Get FWTS and run

fwts wmi -

And you will see how is it implemented and what is possible to read/modify.

More here: https://wiki.ubuntu.com/Kernel/Reference/WMI



标签: linux wmi