Tuesday, May 11, 2010

Landesk local schedular restart

Found this here and it works well in a pinch:
http://community.landesk.com/support/thread/4648


: This script will delete the clients landesk database, recreate it, validate it and clean up
: old xml files/ Any xml files that are still required will repopulate as needed
: this is also good at fixing portal and other policy issues



cmd /c del "c:\documents and settings\all users\application data\landesk\managementsuite\database" /q
del "C:\Documents and Settings\All Users\Application Data\LANDesk\ManagementSuite\landesk\files" /q
del "C:\Documents and Settings\All Users\Application Data\vulScan\*.xml" /q
del "C:\Program Files\LANDesk\LDClient\sdmcache\landesk\files\*.xml" /q
net stop "Landesk Policy Invoker"
"c:\program files\landesk\ldclient\clientdbutil.exe" /create
"c:\program files\landesk\ldclient\clientdbutil.exe" /validate
net start "Landesk Policy Invoker"
"c:\program files\landesk\ldclient\policy.sync.exe"
"c:\program files\landesk\ldclient\policy.client.invoker.exe"
EXIT /B 0

NTP Query Program

I work with a lot of slow network connections, I know lucky me. Here is a command that you can use in ESX to allow you to test your NTP connectivity. This is a regular Linux command as well. Use the "timeout value" if you need to add a length of time before a timeout occurs.

ntpq -p -c "timeout 5000" timeserver_name

Wednesday, May 5, 2010

cron for tcpdump script

Recently I needed to sniff some traffic at one of my remote data centers. I brought up an old box with linux and needed to capture some traffic every 15 minutes.

This script will create a file with a date and time for the name then start dumping tcpdump data to it. Here is my script that I used to grab the traffic:

#!/bin/bash
killall tcpdump
var=$(date +%G%m%d-%k%M)
/usr/sbin/tcpdump -i eth0 -C 10 -w /home/user/$var.txt

Since the first line of the script kills any tcpdump processes that are currently running, I just set the crontab to run every 15 minutes, it will kill the last tcpdump and create a new file and start the process all over again.

Here is the crontab statement:

00,15,30,45 * * * * /path_to_crantab.sh

expand virtual hard disk of a guest in ESX 4 part II

A while back I wrote about expanding virtual hard drives. The ESX side of things was very slick but the windows side was definitely not. Too bad my ESX 4 class was not a month earlier! There I learned about a free utility from dell called Extpart.exe.

This handy little gem will expand 2000, XP, and 2003 windows partitions (including boot partitions) on the fly! It would have saved me tons of time over the method I was using with gparted and rebooting the guest boxes.

vCenter lesson learned

I discovered last night a very important lesson. the ODBC connections that are used for vCenter that points to an external database are not dynamic. By dynamic I mean trying to change the ODBC pointer in windows will not change the ODBC settings for vCenter! So after going through the register I discovered that when vCenter installs it takes the username and encrypts the current password. What this means is that if you change the ODBC username and/or password vCenter will still try to use the info it detected at install.

I am sure there was a way to change this but due to other issues I was fighting on my vCenter server and changes to our database server a reinstall of vCenter was done. This did correct the issue. One other note vCenter is smart enough when you reinstall to detect a currently used database and asks if you want to use it or create a new one.

Monday, May 3, 2010

Check uptime on a windows 2000, XP, 2003 box

Check uptime with Windows 2000, XP, 2003.

1. Go to "Start" -> "Run".

2. Write "CMD" and press on "Enter" key.

3. Write the command "net statistics server" and press on "Enter" key.

4. The line that start with "Statistics since …" provides the time that the server was up from.


* The command "net stats srv" can be use instead.