Each value gets added to an attribute on the device that you run this script against. Just add the percent variable for the attribute that you want to display in your email action.
For example:
%Device.Attribute.AttributeName
If you wanted to display the attribute called SerialNumber you would use:
%Device.Attribute.SerialNumber
You can also add a title in front of the variable:
Serial Number: %Device.Attribute.SerialNumber
If ping is down, yes, but I originally created this script to provide actual disk space. We use disk space WMI monitors to alert if a drive is 90% Full. So when a disk exceeds that threshold we receive the alert with updated free mb/gb and actual percentage free. This way we don't have to log onto the computer to see that a 300 GB drive still has 30 GB free, which means it doesn't need to be addressed immediately. MS says that disk performance is degraded when it's running at 90% full or greater, which is why we have these alerts setup, but with most disks being quite large these days, these alerts often get put to the side since there is still actually plenty of space remaining.
Absolutely, that's how we do it except I have it run as soon as a device status changes to Down. I have the script set up as an Active Monitor just so I can test it and manually populate attributes on devices. I use the same script as an Action and have it applied to all Action Policies, again when a device status changes to Down.
I corrected the error handler so you can now see the actual error. Just move line 57 (objWMIService.Security_.impersonationlevel = 3) to line 174 (below Else statement).
I also updated the way that disk space is displayed. Rather than each disk being seperated by a pipe | I have each disk on it's own line. It's really just personal preference but I think it reads a lot better. Replace lines 206 - 212 with the code below. This also adds percentage full to the end of the line. Keep in mind that the end of the string must end in a period otherwise Outlook will remove the extra line breaks and the entire string will end up on one line.
' *** Disk Space ***
Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk WHERE Description = 'Local Fixed Disk'")
For each objDisk in colDisks
sDiskID = objDisk.DeviceID
sFree = Round(objDisk.FreeSpace / ConvertKB2GB, 2)
sTotal = Round(objDisk.Size / ConvertKB2GB, 2)
sUsed = sTotal-sFree
sPercent = Round(sUsed / sTotal, 2) * 100
sDisk = sDisk & "Disk " & sDiskID & " " & sFree & " GB Free of " & sTotal & " GB (" & sPercent & "% Full)." & vbCrLf
Next
' *** Remove last vbCrLf from end of string (sDisk) ***
iLen = Len(sDisk)
sDisk = Left(sDisk, iLen - 2)
You can create a passive monitor to monitor the event logs and use the expression editor to detect the drive you want to monitor. The event log contains the drive letter VSS is having trouble with.
Does this help?