Sunday 20 April 2014

Save and clear Eventlogs

Hello friends

This time i am posting "How to save and clear Eventlogs"

if most of your production servers are running on VM (virtualmachines) the space on OS drive (C) may reach above threshhold in that case you need to
clear some space.we can clear temp files and compress some logs.apart doing
all these we can create a powershellscript to save and clear eventlogs.


$applog=Get-WmiObject win32_nteventlogfile -Filter "logfilename = 'application'"
$date=Get-Date -Format ("dd-MM-yyy-mm-ss")
$applog.backupeventlog("d:\Applicationlog_$date.evtx")
$applog=Get-WmiObject win32_nteventlogfile -Filter "logfilename ='system'"
$applog.backupeventlog("d:\systemlog_$date.evtx")

Clear-EventLog -Log application,system






 

Friday 21 March 2014

Resetting ILO's from Command Line

Last week i got a request from Application team to reboot few HP servers.

usually we use shutdown -i -r from run to reboot i have initiated the reboot and waited for more than  30 minutes but system is not coming up machine was in hung state. I tried to restart the machine using ILO. Unfortunately ILO is also not 
helping.then I seek one of my colleges help in resolving this issue and this is very good tip.

we can restart  machine using ILO commands.

use plink utility to login to the ILO.

HP Servers

Plink to the ILO ip with ID/Password.

 Plink 1.2.3.4 ( iloipaddress)


provide username and password


it will take you to the prompt :
</>hpiLO-> cd /map1
status=0
status_tag=COMMAND COMPLETED

</map1>hpiLO-> reset
status=0
status_tag=COMMAND COMPLETED
Resetting iLO. 

CLI session stopped.
You can even shutdown/restrat the server from here.
For more commands   type "help"


thanks to my brother AZAM

Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress

#Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress # use...