Typeperf – Windows Command Line Monitoring Tools

typeperf is a good tools for Windows IT Professional to monitoring their server/PC through command prompt instead of GUI interface.

To understand more on typeperf, simply type in typeperf /?

To get all of the counter that can be listed in typeperf, you may enter the following command,

C:\> typeperf –q > c:\counter.txt

To define a counter live from your PC,

C:\> typeperf "\processor(*)\% Processor Time"

If you prefer to get from remote server,

C:\> typeperf "\processor(*)\% Processor Time" -s mickgenie.localhost

 

Windows:Run Task Scheduler with System user

Task scheduler or scheduled task is very important for a system administrator to manage the self design script to monitor from a server.

However, you might found out when you schedule a task from Windows Server 2003 with your used user such as batch file with .bat, you will get a command prompt popped up every time you are performing other task where this is annoyed.

To overcome this problem, I just found out that we can use System user to set the task without worry the above problem and it could solve when you have implement forced password change from a server.

I have come out the solution for Windows Server 2003 and Windows Server 2008.

Windows Server 2003,
With Windows Server 2003, you may look for the scheduled task from Control Panel, and look for Scheduled Task.

If you are creating the new task, just enter the information needed and use the user of “System”(Exactly, case sensitive) as the user.
Note: System or NT AUTHORITY\SYSTEM, where I will use System only where it is easy to remember.

If you are modifying old task, change the user to System and use empty password.

Windows Server 2008,
With Windows Server 2008, go to the Administrative tool and look for Task Scheduler.

When you create the task or modify it, just click the button of “Change User or Group…” and change it to SYSTEM. That all.

Creating SSL MySQL from Windows

Assumed that you will going to install OpenSSL and you wish to apply to your MySQL if you are using Windows Operating System.

1. Download OpenSSL from URL here.
2. Once installation done, add your bin folder of the OpenSSL to your Environment Variable.
3. Open command prompt.
4. Follow the command as below.
cd \
openssl
If you see the result return is “OpenSSL>”, that mean you have successfully installed.
5. Open the MySQL command and refer to the following line.
shell> md c:\newcerts
shell> cd c:\newcerts
6. Test your certificate.
shell> mysqld –defaults-file=$DIR/my.cnf &

How to use Linux Screen

Screen is one of the powerful command in Linux(Unix System) that allow user to run command in remote mode and this is to avoid connection timed out or etc issue causing the previous launched command stopped.

You may install screen by running yum or apt-get depending on your box, then you can start screen by typing screen at the command prompt.

screen

Once screen session has started, you can use the following commands to mess around:

– Ctrl + A + ‘c’ = To open a New Windows
– Ctrl + A + ‘n’ = next window (if you have multiple windows running)
– Ctrl + A + ‘0…9’ = go to window number x where it should come with 0 to 9.
– Ctrl + A + ‘d’ = detach from a window. Say, if you want to close your session and return later.
– Ctrl + ‘d’ = detach and clear the screen session,

To re-attach to a screen, you may need to check the number of screen is running.

screen -ls


This will display the screens currently running, you could run the command as below to resume the screen session.
[code]$ screen -x pid.tty.user[/code]