Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Member List  Search  FAQ  Ticket List  Log Out

 

Scripts: CheckCPUUsage, CheckHardDrives, CheckServices, CheckMemory

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Networking & Security] >> GFI Network Server Monitor >> Scripts: CheckCPUUsage, CheckHardDrives, CheckServices, CheckMemory Page: [1]
Login
Message << Older Topic   Newer Topic >>
Scripts: CheckCPUUsage, CheckHardDrives, CheckServices,... - 20.Jan.2005 3:18:00 AM   
schnazzy

 

Posts: 32
Joined: 2.Apr.2004
From: Seattle
Status: offline
Ok, The new scripts are available. In any of these scripts there is a TEST section that you can uncomment out (3 lines) and run it on your GFI server to troubleshoot the monitor. If it doesn't work you have a server or credential issue. The test effectively removes GFI NSM as a factor to reduce troubleshooting.

CheckCPUUsage has 5 variables; ServerName, Username, Password, Single CPU Max, Average of all CPU's Max. Only ServerName is required. If just "" put in for username and password the script uses the GFI service account connection. If you put "" for both or either of the last 2 variables I put 80% for any one CPU and 60% for all CPU's. In my production environment I use 90% and 70%. This is 1 check for all processors on a machine!

CheckHardDrives has 5 variables; ServerName, Username, Password, minimum MB available, minimum % available. Only ServerName is required. If just "" put in for username and password the script uses the GFI service account connection. If you put "" for both or either of the last 2 variables I put 1024MB and 10% in place of the blank entry. In my production environment I use 1024MB and 0%. This is 1 check for all Hard Drive volumes on a machine!

CheckMemory has 5 variables; ServerName, Username, Password, minimum MB available, minimum % available. Only ServerName is required. If just "" put in for username and password the script uses the GFI service account connection. If you put "" for both or either of the last 2 variables I put 128mb and 10% in place of the blank entry. In my production environment I use 50MB and 0%. This is 1 check for all Hard Drive volumes on a machine! You may have issues with SQL servers (I don't because I have huge RAM allocations and set the usage for SQL and the OS). This is the Physical Memory check not Virtual. This is used primarily to see when your Physical memory is being all used up (resulting in large swapping operations).

CheckServices has 3 variables; ServerName, Username and Password. Only ServerName is required. If just "" put in for username and password the script uses the GFI service account connection. This version checks for all AUTO-START services and makes sure they are in a RUNNING state. There is an ignorelist for special AUTO-START services that generaly are not in a RUNNING stat like the "Performance Logs and Alerts". This script does not attempt to restart the service which can be done by default in the OS (W2k3) or in GFI NSM. Also, the list is hard coded (but you can edit it) in the function. In the next version I MAY add a restart option and I probably will move the ignorelist out of the function and let you type them in the GFI NSM UI. (comma delimited).

All the above scripts can be found at alexhertz.com .

All script work in both NSM 5.5 and NSM 6.0 (beta). In reality the scripts work really well in NSM 6.0 due to the new credential options. By the way, if you don't know why you might need to use credentials for these scripts the general scenario is that GFI NSM is running as an admin that is recognized on the remote servers you are monitoring however you have some machines in a DMZ or different domain that do not recognize the admin account you are using and you must specify specific credentials for the monitor.

The above scripts may only be able to monitor with NSM 5.5-6.0 as the server and Windows 2000 SP3+/Windows 2003 as the monitored devices.

There are 3 scripts that are not available yet;
CheckExchange - I have a version I use now and it does a good job (at least the same as the default Exchange one from GFI). However I have been researching some other checks (besides RPC, and queue) and might be able to implement them soon. I may post the current version as a first step.

CheckICMP - Maybe you should use the GFI NSM ICMP check instead, maybe not. I let you choose the ping amounts and timeouts per. I also let you error on slowness. You can set it to 4 checks and timeout of 2000ms per check. Then set it as a failure if it doesn't get a reply OR you set a minimum response time. The minimum response time can be for the Minimum, Maximum, or average response times. Example "MAX122" which is Maximum of 122ms. The script runs, the server is there but the response time is 123ms therefore you get a failure. Obviously 122 might be a bit slow.

CheckProcesses - This script is becoming very cool. Without writing 300 lines of notes, basically it will check the server and make sure no new processes are running (security issue) and/or it will check to make sure all the required processes are running (outage issue), and will check handle and thread maximums per process (and configurable per process) for you memory leak freaks. There is no eta. If there are requests for the script it still probably wouldn't be done till February sometime.

I have other ideas for checks that side toward security. I have asked GFI to add "levels" for each check so I they can be defined as High, medium, or low priority so in the case of a low hard drive I don't get a page at 3am but ICMP failure would prompt a wakeup call. No idea if/when it will make it in the product.

If you have other checks in mind let me know. If you find bugs let me know however note that these scripts even in their latest version have been running on about 50 production servers for over a month (NSM 5.5) and a few weeks with alpha/beta NSM 6.0.

Things I am working on... Sending SNMP traps to other management software for monitoring unification. Trending (historical graphs). Don't hold your breath for either.

Sorry for the long post but otherwise it was going to be 4 posts and I thought this was better.

Alex
Post #: 1
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 20.Jan.2005 10:07:00 AM   
totalstu

 

Posts: 31
Joined: 19.May2004
From: Toronto
Status: offline
Thanks for the effort and good work.

Being that I'm VB challeneged, I'm not sure how to correct an error i'm getting using the check memory script. The error is as follows: Compilation Error: Line 114 Char 4 - Name redefined. If I open the script in notepad I don't have 114 lines. I only count 108 lines.

Any suggestion/guidance would be much appreciated.

Thanks

Stuart

(in reply to schnazzy)
Post #: 2
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 20.Jan.2005 1:25:00 PM   
schnazzy

 

Posts: 32
Joined: 2.Apr.2004
From: Seattle
Status: offline
Assumption:
You put the script on your GFI server unmolested (you did NOT make any modifications).

If the above is true then uncomment the 3 lines in the script (by taking out the single quote at the beinging of each line);
'Dim EXPLANATION
'wscript.echo CheckMemory("servername", "", "","","")
'wscript.echo EXPLANATION

Then run the script from a command line. You will need to be in the /scripts directory where the ah_checkmemory.vbs is at. You will need to be logged in as an admin with rights to the remote box you will specify below OR you must specify credentials for the remote box. Here is how you run the command (replace myserver with the name of the server you want to check).
cscript.exe ah_checkmemory.vbs "myserver".

The script MUST be recommented for GFI to run it or you will get an error similar to the one you are getting. hmmmm [Wink]

Alex

(in reply to schnazzy)
Post #: 3
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 20.Jan.2005 2:29:00 PM   
totalstu

 

Posts: 31
Joined: 19.May2004
From: Toronto
Status: offline
Ok, I got the test to run but when I recomment the 3 lines I get a new error.
Runtime error: Line 123 Char 0. Wrong number of arguments or invalid property assignment: 'CheckMemory'

Please advise.

Thanks

Stuart

(in reply to schnazzy)
Post #: 4
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 20.Jan.2005 4:53:00 PM   
schnazzy

 

Posts: 32
Joined: 2.Apr.2004
From: Seattle
Status: offline
There are 5 parameters that you need to take care of:
parameters1 = "myserver"
parameters2 = "myusername"
parameters3 = "mypassword"
parameters4 = "128"
parameters5 = "10"

While you don't have to put anything between the quotes for any parameters except parameter1:

parameters1 = "myserver"
parameters2 = ""
parameters3 = ""
parameters4 = ""
parameters5 = ""

YES the Double Quotes ARE REQUIRED even if you don't put anything in them. While this is not a bug with either my script OR NSM, I have requested a feature change to resolve variable parameters. (meaning, the function may have have 5 parameters but you don't need to send 5 to it (if the script can handle it)).

Alex

(in reply to schnazzy)
Post #: 5
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 21.Jan.2005 1:56:00 PM   
totalstu

 

Posts: 31
Joined: 19.May2004
From: Toronto
Status: offline
The reason the test didn't work initially was that I didn't uncomment the three lines. I did change the "servername" to reflect the name of my server. I uncommented, did the test and it ran fine. I then commented back those 3 lines and then let GFI do its thing and that is when the next error showed up. I did fill out the parameter sections, though only using the 1st parameter (which is the name of the server in quotes).

Stuart

(in reply to schnazzy)
Post #: 6
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 22.Jan.2005 5:57:00 PM   
schnazzy

 

Posts: 32
Joined: 2.Apr.2004
From: Seattle
Status: offline
so is it working or not?

It sounds like you uncommented to test, then forgot to recomment.

The next issue was due to the 5 parameters no being filled out (even with "").

Let me know.

Thanks

(in reply to schnazzy)
Post #: 7
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 25.Jan.2005 9:56:00 AM   
totalstu

 

Posts: 31
Joined: 19.May2004
From: Toronto
Status: offline
Hi,

It's working like a charm. It was an issue of me being dense and not putting the "" in the parameter fields that i am not using.

Thanks

(in reply to schnazzy)
Post #: 8
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 15.Jan.2007 2:10:16 PM   
escotoj

 

Posts: 2
Joined: 11.Jan.2007
Status: offline
Where did all of these scripts go?

(in reply to schnazzy)
Post #: 9
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 31.Jan.2007 9:53:07 AM   
dmute

 

Posts: 1
Joined: 31.Jan.2007
Status: offline
Hi,

Thanck you for the scripts, but one question : where could i download the script please ?

(in reply to escotoj)
Post #: 10
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 4.Feb.2007 6:54:19 AM   
cop3ccpotter

 

Posts: 12
Joined: 8.Jun.2006
Status: offline
Where can we download or review your scripts? The link to alexhertz.com no longer works for me.
Your help is much appreciated.

(in reply to schnazzy)
Post #: 11
RE: Scripts: CheckCPUUsage, CheckHardDrives, CheckServi... - 18.Nov.2007 11:55:52 AM   
TGREG

 

Posts: 4
Joined: 27.Oct.2007
Status: offline
Can somebody repost these scripts?

(in reply to schnazzy)
Post #: 12
Page:   [1]
All Forums >> [Networking & Security] >> GFI Network Server Monitor >> Scripts: CheckCPUUsage, CheckHardDrives, CheckServices, CheckMemory Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts