Closed LeeThompson closed 3 years ago
If you want to add this to the main wmi functions there are some other fields you might want to be aware of:
When you do the ConnectServer the parameters are (italics are optional fields):
(NOTE: I'm not sure parameters 8 and 9 are relevant to PHP)
Other notes:
It's strange that there isn't a way to set the timeout, it's no timeout at all (which can hang indefinitely) or the two minute one with the flag. phpSysInfo should probably be using the 0x80 flag.
Try https://github.com/phpsysinfo/phpsysinfo/commit/45fc9edc61d4624e2444855b290c5327a1e5e621
phpsysinfo.ini [main] block: WMI_HOSTNAME="192.168.0.23" WMI_USER="User" WMI_PASSWORD="UserPass"
possibly additionally: MAX_TIMEOUT=60
For only hyperv plugin define WMI_HOSTNAME, WMI_USER and WMI_PASSWORD in [hyperv] block instead [main]
Works great, thanks!
Used the [hyperv] option.
(This should also help Windows users so they don't have to run the web process with high permissions as well since they can give WMI credentials in the .ini)
I don't have the experience to do this as a PR but here are some enhancements for the Hyper-V plugin.
This adds 3 new variables (they would need to be set and passed in somewhere):
If they are null, this will work as it has always worked.
This allows the plug-in to connect to a different computer to get Hyper-V data (for cases where the Hyper-V host is not on the same machine as the web server).
(This could be expanded to the general WMI function as well to at least provide credentials for the connection.)
(Also /data/hyperv.txt needs to be documented as to what it expects in the file as far as I can tell it wants a list of ElementName| EnabledState).
class.hyperv.inc.php
This is a snippet for the start of execute: