headlines
Examples: IT scenarios
This page describes searches that might be helpful in IT situations.
- Example 1: How much storage is available on the server?
- Example 2: When was the server rebooted last?
- Example 3: Show me the memory stats on this server
Example 1: How much storage is available on the server?
This query finds out how much storage is available on a critical server, such as your email server. To find this information, the query must specify the system name of the server and its local drive:
SELECT systemname||' '||name,freespace FROM /network/device/wmi/win32_logicaldisk WHERE drivetype = 3 and systemname = 'X'
Depending on your server, this query returns results like this:
This query searches for the amount of free space available in the local disks on
Server X. If you want to try this query against your data, replace the 'X'
with the name of a critical server in your network, such as your email server.
Note that the WHERE clause: drivetype = 3 rules out irrelevant
disks such as CD drives, shared drives, or floppy drives, if any.
If you want to keep track of the results, you can create a Paglo alert to let you know when this condition changes:
Example 2: When was the server last rebooted?
This query finds the date of the last time Server X was rebooted. If you want to try this query against your data, replace the 'X' with the name of a critical server on your network:
SELECT csname as "Computer Name",
lastbootuptime as "Last Booted"
FROM /network/device/wmi/win32_operatingsystem
WHERE csname = 'X'
Depending on your server, the query returns results similar to this:
If you want to keep track of the results, you can create a Paglo alert to let you know when this condition changes:
Variation:
You can gather the same information about all servers on your system by removing the WHERE clause from this query. In this example, the results are sorted by the reboot date, in descending order:
SELECT csname as "Computer Name",
lastbootuptime as "Last Booted"
FROM /network/device/wmi/win32_operatingsystem
ORDER BY 2 DESC
Depending on your network, the query returns results similar to this:
Example 3: Show me the memory stats on this server
This query finds the memory statistics on Server X and displays them as a table. To use
this query against your own database, replace the 'X' in the where clause:
WHERE csname = 'X' with the name of your server:
SELECT csname as "System",
format(1000 * ../win32_logicalmemoryconfiguration/totalvirtualmemory,
'human_bytes') as "Total Virt. Memory",
format(1000 * ../win32_logicalmemoryconfiguration/availablevirtualmemory,
'human_bytes') as "Available Virt. Memory",
format(1000 * (../win32_logicalmemoryconfiguration/totalvirtualmemory -
../win32_logicalmemoryconfiguration/availablevirtualmemory),
'human_bytes') as "Current Usage",
format(1000 * ../win32_logicalmemoryconfiguration/totalpagefilespace,
'human_bytes') as "Page File Space"
FROM /network/device/wmi/win32_operatingsystem
WHERE csname = 'X'
Depending on your server, the query returns results similar to this:
Note: The query calculates the current usage by subtracting the available virtual memory from the total virtual memory in this line:
. . .
format(1000 * (../win32_logicalmemoryconfiguration/totalvirtualmemory -
../win32_logicalmemoryconfiguration/availablevirtualmemory),
'human_bytes') as "Current Usage",
. . .
Variation:
You can see the memory stats of all your servers by simply removing
the WHERE clause: WHERE csname = 'X' from the
query. Depending on your network, the query produces results similar to this:

