#!perl -w use strict; use DBI; use Data::Dumper; my $dbh = DBI->connect('dbi:WMI:', undef, undef, {RaiseError => 1}); sub dump_wql { my $res = $dbh->selectall_arrayref($_[1], {}); print $_[0], Dumper $res; }; dump_wql('Ping 192.168.1.1', <<''); select responsetime from Win32_PingStatus where Address = '192.168.1.1' dump_wql('CPU load', <<''); select Name,LoadPercentage from Win32_Processor dump_wql('Network connections', <<''); select RemotePath,ConnectionState from Win32_NetworkConnection