| | | Time Traveler
       
Group: Forum Members Last Login: 7/8/2008 10:38:45 AM Posts: 534, Visits: 1,875 |
| KvChaos (3/19/2008)
Maybe a bit out of point, but is there a smiliar script for Processor counter as well?
And good job for this Logical Disk COunter script. It works great.. finally. 
No, there is not (or at least, I didn't wrote one, and I don't know of another one).
Hi
I don't know where you found the sql value to make the script????
I want to do the same for the memory usage and CPU, but i don't know where you got the name of variable.
Thanks for your script
I used the DB schema, available there :
http://www.ipswitch.com/support/whatsup/index.asp |
| | | | Forum Member
       
Group: Forum Members Last Login: 6/20/2008 5:33:31 AM Posts: 38, Visits: 160 |
| ooh thanks
I tried to open the database with sql server and many other way ..... i just have to gon on the website... thanks a lot |
| | | | Forum Member
       
Group: Forum Members Last Login: 6/20/2008 5:33:31 AM Posts: 38, Visits: 160 |
| My script Works Well, and i've another question I ever ask on the forum about another subject :
I set the value of maximum memory used to 10%, so the monitor is down. When i use the test function, it tell me this :
"Failure: Memory Physical Memory is 82 % full | Memory Virtual Memory is 29 % full | "
It's really an interressant information, is there any way to get it for example on a mail, orin a report Log and no just in this test function???
When i set the value ton 90%, it return me : Ok
thanks for your help |
| | | | Forum Member
       
Group: Forum Members Last Login: 6/20/2008 5:33:31 AM Posts: 38, Visits: 160 |
| Hi all
I try to get the informartion i describe on the last post with the event viewer.
To do this, i use this command type :
Context.LogMessage( " Hello ");
Where could i see the information send??? I start the nmeventviewer ( in Ipswitch/what's up gold/eventviewer.exe ) and i connect to ip where what's up is running ( it's my local computer )
I see information in the event viewer, but nothing about the test i want, and information i get is about state change or id change.
Someone could help me???
thanks |
| | | | Junior Member
       
Group: Forum Members Last Login: Yesterday @ 1:35:16 PM Posts: 23, Visits: 170 |
| kar98ghost (5/5/2008) Hi all
I try to get the informartion i describe on the last post with the event viewer.
To do this, i use this command type :
Context.LogMessage( " Hello ");
Where could i see the information send??? I start the nmeventviewer ( in Ipswitch/what's up gold/eventviewer.exe ) and i connect to ip where what's up is running ( it's my local computer )
I see information in the event viewer, but nothing about the test i want, and information i get is about state change or id change.
Someone could help me???
thanks
Did you remember to turn on the debug mode? You can do that by right-clicking in the event viewer, then going down to the "Debug On" line and left-clicking on it. |
| | | | Time Traveler
       
Group: Forum Members Last Login: 7/8/2008 10:38:45 AM Posts: 534, Visits: 1,875 |
| kar98ghost (5/5/2008)
Context.LogMessage( " Hello ");
Where could i see the information send??? I start the nmeventviewer ( in Ipswitch/what's up gold/eventviewer.exe ) and i connect to ip where what's up is running ( it's my local computer )
AFAIK, you can only see it in the Test ox, but you may be able to see it in the WUG Event viewer, if debug is turned on.
For your first question about how to include the text in a email :
1- either you use an Active Monitor at the monitor level, and you can use the variable %ActiveMonitor.Payload (you should see the string provided in the Context.SetResult method in your script).
2- OR you insert the result in a device attribute, as I do in my disk script, and use the %device.attribute. variable. The advantage being that you can apply the action at the device-level.
BTW, the script output you posted seems like a custom memory script. Did you adapt the disk script in order to check for memory ? If yes, is it possible you share it on this forum ? I think it might interest some people. |
| | | | Junior Member
       
Group: Forum Members Last Login: Yesterday @ 1:35:16 PM Posts: 23, Visits: 170 |
| MB - NS (5/12/2008)
kar98ghost (5/5/2008)
Context.LogMessage( " Hello ");
Where could i see the information send??? I start the nmeventviewer ( in Ipswitch/what's up gold/eventviewer.exe ) and i connect to ip where what's up is running ( it's my local computer )
AFAIK, you can only see it in the Test ox, but you may be able to see it in the WUG Event viewer, if debug is turned on.
For your first question about how to include the text in a email :
1- either you use an Active Monitor at the monitor level, and you can use the variable %ActiveMonitor.Payload (you should see the string provided in the Context.SetResult method in your script).
2- OR you insert the result in a device attribute, as I do in my disk script, and use the %device.attribute. variable. The advantage being that you can apply the action at the device-level.
BTW, the script output you posted seems like a custom memory script. Did you adapt the disk script in order to check for memory ? If yes, is it possible you share it on this forum ? I think it might interest some people.
I have a script for checking the physical memory using WMI as a Custom Performance Monitor, but the property CredWindows assword does not work properly. I have to hard-code it into the script. I'm hoping WUP 12 fixes that issue. |
| | | | Forum Member
       
Group: Forum Members Last Login: 6/20/2008 5:33:31 AM Posts: 38, Visits: 160 |
| Somebody Help me in another topic ( really thanks to him ) fo memory utilization, i adapt the script for Cpu Utilisation.
The script turn the monitor down if the value of physical Memory is higher than 90% ( or another value ) during 3 hours ( you can easily change this value too ) .
So it can avoid the device to get down if memory is used during few minutes.
It work similary for CPU, if you have many cores, it take the average of utilization of all cores
For The cpu
// Set the result code of the check (0=Success, 1=Error)
Context.SetResult( 0, "No error");
// WUP Database connect
var oDb = Context.GetDB;
if (null == oDb) {
result = false;
err += "WUP DB inaccessible! ";
} else {
Context.LogMessage("DB OK");
// Get DeviceID
var deviceID = Context.GetProperty("DeviceID");
// Get the Percentage (3H average to maximum) for check
var sSql = "SELECT nProcessorLoad_Avg AS Perc FROM StatisticalCPU SM JOIN StatisticalCPUIdentification SMI ON SM.nStatisticalCPUIdentificationID = SMI.nStatisticalCPUIdentificationID JOIN PivotStatisticalMonitorTypeToDevice SMT ON SMI.nPivotStatisticalMonitorTypeToDeviceID = SMT.nPivotStatisticalMonitorTypeToDeviceID WHERE dPollTime > DATEADD(hh,-3,GETDATE()) AND nDeviceID = '"+deviceID+"'";
var rs = oDb.Execute(sSql);
var perc = rs("Perc")+0;
var perc = perc/100
Context.LogMessage("Perc: "+perc);
rs.Close();
oDb.Close();
}
// Set result Code
if (perc > 0.8) {
Context.SetResult( 1, "The average utilisation during the last 3 hours was greater than 90%");
} else {
Context.SetResult( 0, "Utilisation Ok");
For the Memory (only physical )
// Set the result code of the check (0=Success, 1=Error)
Context.SetResult( 0, "No error");
// WUP Database connect
var oDb = Context.GetDB;
if (null == oDb) {
result = false;
err += "WUP DB inaccessible! ";
} else {
Context.LogMessage("DB OK");
// Get DeviceID
var deviceID = Context.GetProperty("DeviceID");
// Get the Percentage (3H average to maximum) for check
var sSql = "SELECT Round(AVG(nUsed_Max),0) / nSize AS Perc FROM StatisticalMemory SM JOIN StatisticalMemoryIdentification SMI ON SM.nStatisticalMemoryIdentificationID = SMI.nStatisticalMemoryIdentificationID JOIN PivotStatisticalMonitorTypeToDevice SMT ON SMI.nPivotStatisticalMonitorTypeToDeviceID = SMT.nPivotStatisticalMonitorTypeToDeviceID WHERE dPollTime > DATEADD(hh,-3,GETDATE()) AND sType = 'RAM' AND nDeviceID = '"+deviceID+"' GROUP BY nSize";
var rs = oDb.Execute(sSql);
var perc = rs("Perc")+0;
Context.LogMessage("Perc: "+perc);
rs.Close();
oDb.Close();
}
// Set result Code
if (perc > 0.7) {
Context.SetResult( 1, "The average utilisation during the last 3 hours was greater than 90%");
} else {
Context.SetResult( 0, "Utilisation Ok");
}
Hope it can be useful to someone |
| | | | Forum Newbie
 |
| |
|