Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

2007/04/04

Windows Perfmon: The Top Ten Counters

One of the things I love about Windows is Performance Monitor a/k/a PerfMon. It's an amazing tool that goes far too often unused - and when it does get used, it is often misinterpreted. So today I'm going to take you on the nickel tour through PerfMon, and the ten counters most valuable to determining overall system health and activity.

To open PerfMon, just go to the Start Menu, choose Run and type perfmon.
Bottleneck analysis
The most common use of PerfMon is to answer the burning question: why is my system running slow?

With the five performance counters listed below, you can quickly get an overall impression of how healthy a system is - and where the problems are, if they exist. The idea here is to pick counters that will be at low or zero values when the system is healthy, and at high values when something is overloaded. A 'perfectly healthy' system would show all counters flatlined at zero. (Perfection is unattainable, so you'll probably never see all of these counters flatlined at zero in real life. The CPU will almost always have a few items in queue.)
  • Processor utilization
    • System\Processor Queue Length - number of threads queued and waiting for time on the CPU. Divide this by the number of CPUs in the system. If the answer is less than 10, the system is most likely running well.
  • Memory utilization
    • Memory\Pages Input/Sec - The best indicator of whether you are memory-bound, this counter shows the rate at which pages are read from disk to resolve hard page faults. In other words, the number of times the system was forced to retreive something from disk that should have been in RAM. Occasional spikes are fine, but this should generally flatline at zero.
  • Disk Utilization
    • PhysicalDisk\Current Disk Queue Length\driveletter - this is probably the single most valuable counter to watch. It shows how many read or write requests are waiting to execute to the disk. For single disks, it should idle at 2-3 or lower, with occasional spikes being okay. For RAID arrays, divide by the number of active spindles in the array; again try for 2-3 or lower. Because a shortage of RAM will tend to beat on the disk, look closely at the Memory\Pages Input/Sec counter if disk queue lengths are high.
  • Network Utilization
    • Network Interface\Output Queue Length\nic name - is the number of packets in queue waiting to be sent. If there is a sustained average of more than two packets in queue, you should be looking to resolve a network bottleneck.
    • Network Interface\Packets Received Errors\nic name - packet errors that kept the TCP/IP stack from delivering packets to higher layers. This value should stay low.
To highlight a particular counter's line on the graph, select that counter in the lower pane. Then click the lightbulb icon on the toolbar above the graph. This will make the line for that counter turn thick and white (or black on some systems - I never found out why this changes).

Pay close attention to the scale column! Perfmon attempts to automatically pick a scale that will magnify or reduce the counter enough to produce a meaningful line on the graph ... but it doesn't always get it right. As an example, Perfmon often chooses to multiply Disk Queue Length by 100. So, you might think the disk queue length is sustained at 10 (bad!) when in fact it's really at 1 (good). If you're not sure, highlight the counter in the lower pane, and watch the Last and Average values just below the graph. In the screenshot below, I modified all of the counters to a scale value of 1.0, then changed the graph's vertical axis to go from 0-10.
To change graph properties (like scale and vertical axis as discussed above), rightclick the graph and choose Properties. There are a number of things to customize here ... fiddle with it until you have a graph that looks good to you.
To get a more detailed explanation of any counter, rightclick anywhere in the perfmon graph and choose Add Counters. Select the counter and object that you are curious about, and click the Explain button.
This screenshot shows a very lightly-loaded XP system, with the Memory\Pages Input/Sec counter highlighted:





All we see here is the Proccessor Queue Length hovering between 1 and 4, and two short spikes of Pages Input/Sec. All other counters are flatlined at zero, which is easy to check by highlighting each of them and watching the values bar underneath the graph. This is a happy system - no problems here!
But if we saw any of the above counters averaging more than 2-4 for long periods of time (except Processor Queue Length: don't worry unless it's above 10 for long lengths of time), we'd be able to conclude that there was a problem with that subsystem. We could then drill down using more detailed counters to see exactly what was causing that subsystem to be overloaded. More detailed analysis is beyond the scope of this article, but if there's enough interest I could do a second article on that. Leave a comment if you're interested!
General activity counters
Well, the system is healthy - and that's good ... but how hard is it working? Is the processor workin' hard, or hardly workin'? How much RAM is in use, how many bytes are being written to or read from the disk or network? The following counters are a good overview of general activity of the system.
  • Processor utilization
    • Processor\% Processor Time\_Total - just a handy idea of how 'loaded' the CPU is at any given time. Don't confuse 100% processor utilization with a slow system though - processor queue length, mentioned above, is much better at determining this.
  • Memory utilization
    • Process\Working Set\_Total (or per specific process) - this basically shows how much memory is in the working set, or currently allocated RAM.
    • Memory\Available MBytes - amount of free RAM available to be used by new processes.
  • Disk Utilization
    • PhysicalDisk\Bytes/sec\_Total (or per process) - shows the number of bytes per second being written to or read from the disk.
  • Network Utilization
    • Network Interface\Bytes Total/Sec\nic name - Measures the number of bytes sent or received.
In the graph below, I added these five counters to my existing 'bottlenecks' graph, and changed the vertical axis to go from 0-100. I highlighted the Working Set\_Total counter, which is currently at about 123 megabytes for the system. Notice how it shows a thick line at the top of the graph - you could assume that it was pegged at 100, if you didn't read the values bar (123,052,03 divided by a million is approximately 123 megabytes).



And ... that's all for now. Hopefully this quick show-and-tell has given you enough information to use PerfMon more usefully in the future!

2004/10/27

Find rogue DHCP servers!

Sorry about the lack of new content lately - life has been busy here at the adminfoo ranch. Here's a quick blurb for dhcploc, which can be handy for tracking down rogue DHCP servers.

Basically this commandline tool can run on a Windows host and send a DHCP request, then report all servers which answer. It won't actually claim the DHCP address, though. You can also leave it running for awhile and it will beep and add a new line of output anytime it sees a DHCP request or offer in the wire - all DHCP packets are broadcast so it doesn't need to make your NIC promiscuous. Output looks like this. Packet sniffing (with the right filter) using Ethereal or some such would accomplish the same goal, but dhcploc is a quick and easy tool you can have a remote user (or customer) run for you without a lot of hand-holding.

You can download dhcploc along with some other Windows diagnostic tools here.

2004/09/20

*nix commandline for Windows (free!)

Maybe you already knew: MS is giving away Services for Unix 3.5 (SFU), which can give you a very functional *nix commandline on a Windows box. No more struggling with Cygwin, looking for windows ports of your favorite commandline tools, etc.

But did you know about the Interop Systems Tools Warehouse? Here you can pick up dozens of *nix tools which will run just fine within the SFU environment. Take a walk on the *nix side, baby!

2004/08/30

Network Access Quarantine recipe

Awhile back, we noticed that MS now gives you a way to check for and update hotfixes, AV, and firewall software before connecting VPN clients. This is big stuff; the VPN is the entry point for quite a few malware breakouts. You control your LANs; isn't it time you controlled the VPN?


Security Focus' John Hassel has written a step-by-step guide to building a VPN quarantine control system. While this requires Win2003 server as your VPN endpoint, we think this is a great justification for upgrading at least one of your servers. This could be one of the three best steps you'll take all year in terms of minimizing malware outbreaks. (The other two? Service Pack 2, and keeping enterprise antivirus up to date.)

  • Part 1
  • Part 2

2004/08/28

Rule the rack

Racking up a few servers are you? Worried about getting everything to fit right? This tape measure, graduated in inches and rack units, could be a big help. Fifteen bucks gets you one.





2004/08/20

Windows Startup Online and EventID.net

UPDATE 2005/08/22: Just over a year later, I have found Tasklist.org, another resource which maps programs and vendors to .exe names.

Yesterday I was troubleshooting some odd issues with my new laptop. Although unrelated, I noticed quite a few programs being started automatically when I boot my system up - most of them added by the laptop vendor. So I began investigating to see what they were. This isn't as easy as it should be - while MSCONFIG is a big help, you're still left wondering what 'TpKmapAp.exe' or 'SynTPEnh.exe' actually do, and whether or not you need them starting up every time you boot your computer.

And that's where windowsstartup.com's very handy database of startup programs comes in. It's actually meant as the backend database for their Startup Inspector program (which I haven't tried yet, though it looks nice and is free), but you can query it directly via the web. Excellent idea!

(Added 11/23/2004) For entries missed in the StartupInspector database, I recommend you try ProcessLibrary.com, a similar tool. Between these two, most startup programs should be identified.

I'll round out this post with a similar web database: EventID.net, an online database of things you might find in your event log. Query results will often provide more in-depth explanations of what the log entry means, and what you should do about it. Highly recommended for all you universal troubleshooters.

2004/08/19

Transferring ownership of files

If you're a Windows admin, you've probably 'taken ownership' of files in the past. Did you know it's also possible to 'give ownership'? The normal GUI won't allow you to do it (unless your on a Win2003 server box), but this article shows the way for NT and Win2000 using subinacl.exe.

2004/08/17

Manage your passwords!


Even if you work in a single-signon (SSO) environment, I'll bet you have at least 20 passwords. Probably more.

How are you keeping track of them all? Not the dreaded sticky note on the monitor I am sure - because you're a professional. But here's a funny thing: last Friday I visited a respected professional in his cube and watched him peek at a slip of paper from an unlocked drawer as he logged on to one of our lesser-used servers. He looked sort of sheepish doing it, but it's a real problem. You're supposed to create hard-to-crack passwords that are difficult to remember, and you're supposed to remember them without writing them down. Catch-22.

There are a lot of out there. I use Bruce Schneier's Password Safe for these reasons:

  • I trust Bruce. He's a clear thinker and a hype basher.

  • It's small enough to fit easily on a floppy (remember those?) or a USB key.

  • No install routine, so I can store it on a network share and access from anywhere.

  • It's secure - and it's simple. That's the goal y'know: security made simple.

Of course you should choose whichever password manager you like - just about any password manager is more secure than a piece of paper in a drawer or a wallet, and if it's not comfortable you won't use it. Once you have and use a password manager, you will be more inclined to use really hard passwords - I usually generate random ones with Password Safe.

I keep two password files - one work related and one for my psersonal stuff. Every so often I dump the work related one to a floppy. I write the password on the floppy, seal it in an envelope, sign across the flap, and give it to my boss - in exchange for the old one. This means my replacement can get right to work after I have spontaneously combusted. Might also be handy if the server breaks - I won't have to wait for the full restore to get my passwords back!

I keep a copy of my 'not work' password file in our fireproof safe at home. But it'd be just as good to have a friend or relative hang on to it.

2004/08/08

Create an XP install CD with SP2 preinstalled


Service Pack 2 for Windows XP is out ... but you knew that already, right? It's been done to death at all the other sites, so we won't go nuts with a review of our own (though we do hope to post some interesting SP2 registry hacks soon). We will note that it's getting some pretty strong endorsments though.

So we'd just like to remind you that it's not hard to build a custom bootable XP install CD with SP2 preinstalled. It's called 'slipstreaming', in case you didn't already know, and it can save valuable time when building new systems. Here are a few links which show how to do it:


  • Bink.nu (instructions are for Win2k but work fine with XP and SP1 or SP2).

  • MSFN's 'definitive' unattended guide. Goes futher than the Bink.nu guide into hotfixes, Office updates, applications, device drivers, and more.

  • Autostreamer is a nice looking GUI which builds a slipstreamed disk for you.
    ...if none of these are to your liking, . There are many other guides out there.

2004/07/29

GenControl - a better VNC


Many of you probably read the previous story about KVM-over-IP and wondered: why pay for such a thing? With Terminal Services, exportable X Windows, VNC and other remote control programs, what's the need? Of course the answer is that you most want remote control of a system when the fit has hit the shan: the system is hung, or rebooted and sitting at a BIOS prompt, etc. Without remote KVM capability, the system must stay down while you get dressed, find your keys, and drive to work. With remote KVM (and possibly remote power control, which I'll address at a later date), you simply connect from home and fix the problem.


But for those looking for a decent, non-intrusive and no-cost way of running Windows systems from afar, I present GenControl. This is a modified VNC with a unique twist: it doesn't have to be manually installed at the remote end. You pick a system to control, and GenControl reaches out over then net, installs its server component, then connects you to the console session of the remote system. This happens in under 60 seconds on most WANs. When you're done, GenControl reverses the process, silently de-installing itself. You must have administrative privs on the remote system for this to work. Thus GenControl has no builtin security; it relies on the target OS's security levels.


GC does suffer from the cursor lag found in many VNC versions; however this isn't difficult to get used to. Note that GC grabs the console session on the remote machine, getting around some issues where things act differently in a terminal services session than they would at the console. GC does alllow you to share keyboard/mouse with a person sitting at the console, making this a nice solution for helpdesk support scenarios.

KVM-over-IP becomes affordable


I like to think of server rooms as dark, chilly places, rarely visited by mankind. We go there to install systems, change tapes, and perform the occasional hardware upgrade/repair. But generally speaking, I think this should be a low traffic area. Less jostling leads to more uptime, in my opinion.


Remote management tools such as KVM-over-IP help keep down the traffic in your server room - and they make administration easier. It's just more comfortable to work from your own desk or home office than to spend hours standing at a keyboard in the loud/cold server room. Anytime you make work easier to do, you increase the likelihood that said work will actually get, y'know, done. The problem with KVM-over-IP has been its high price: management couldn't see spending the $10k prices this stuff was commanding just two years ago.


But the world has changed again: now you can get this Aten unit for $500, and there are several other single-port choices in the sub-$1000 range. Connect one of these to your existing KVM switch, and you just might have something that'll let you perform that 2am BIOS upgrade from home, in your jammies. The (pictured) AMI Megarac unit ($800) looks especially attractive to travelling sysadmin types - toss it in your toolbag and use it to connect your laptop directly to that problem headless server. No more lugging monitors from one end of the server room to another!


Has anyone out there used these low-price KVM-over-IP systems yet? Let us know your experiences!

2004/07/23

Quarantine remote clients

MS tool for Windows 2003 remote access services (RRAS) allows remote clients (via VPN) to be quarantined until they prove certain computer settings have been made. Check it out. There is an additional component to allow ISA servers to create access rules based on these quarantine settings.

2004/07/14

5 ways to see disk usage (updated)

Disk full error. We've all seen it; and we've all spent hours finding old/unused files or ferretting out the worst offenders. Here are some visual utilities which can speed that process, and help you communicate the problem to your users and/or management.

  • Sequoiaview: Freeware. Shows disk usage as a lot of subdivided squares or rectangles.
  • SpaceMonger: Freeware. Similar to Sequoiaview, some find this visually easier to use.
  • Scanner: Freeware. Uses a sort of 'concentric piecharts' metaphor. My favorite freeware.
  • DiskData: $30. I use this most often. Produces management-friendly piecharts as well as bar charts and reports. (I take screenshots to of the pie graphs for my mgmt reports)
  • Disk Space Inspector: $30-$250 depending on how you use it. I haven't tried this but it looks nice - especially the ability to save reports and graphics as html.

There are many more out there I am sure. Including more intelligent ones which will sniff out duplicate files, identify filetypes you may not want on your servers (mp3 comes to mind), and so on. Tell us what you're using!

2004/07/08

Three great CD's

Here are three free CD-based tools. The first two are more useful to Windows admins; the last one should please just about everyone. Just download and burn the ISO images.

Pnordahl's Offline Password and Registry Editor: One of the more common problems in the Windows world is the forgotten Administrator password. I used to use Winternals' ERD Commander to reset the password in these cases, but they have gone to a (much!) more expensive and restrictive licensing scheme. The free Pnordahl tool is much faster, though a little harder on the eyes. Note, I have found that this tool is much more reliable if you reset to a blank admin password (specify blank password with an asterisk (*) when prompted) - setting the password to an alphanumeric string doesn't always work. That's ok; just pull the network cord before reboot and set a complex admin password within Windows after blanking it with this tool.

Bart's PE Builder: This kit allows you to build a customized CD of your own. When you're done you'll have a bootable GUI 'mini-OS' with whatever tools you select - you can then use this as a repair environment for seriously sick systems. There's a growing body of plugins and enhancements available; check out the virus scanner plugins!

DBAN: There's only one reason to insert this CD into a system: you want to completely and securely nuke all data on all local writeable drives. Excellent for the final decommissioning of your systems.

2004/07/07

Automating Windows Patch Management (updated)

(UPDATED 7/14/2004 - addition of susserver.com link)

If you have more than 10 Windows systems to admin and you haven't automated your patch management yet, what are you waiting for? SecurityFocus' Jonathan Hassell has written a nice article on SUS and a few tools that add to its capabilities. This is the easy/smart way to deploy updates, and it doesn't sleep like you and I must.

Article Part 1 - Article Part 2 - Article Part 3

Another great resource for SUS is susserver.com - the good folks there have documented some 'under the hood' registry tweaks which can be helpful for advanced tweaking. If there is any interest in the topic, I can add a few scripts I've written, as well as a colleague's impressions of a freeware SUS report tool which we use in production at my day job.

source: SecurityFocus
Older Posts Home