Monthly Archives: December 2013

Alexa – Web site tool

Alexa is a internet based web traffic toolbar , which collects data on browsing behavior and

transmits it to the Alexa website, where it is stored and analyzed, forming the basis for the

company’s web traffic reporting.Alexa Internet, Inc. is a California-based subsidiary company of Amazon.com

The history of name ,Alexa Internet was founded in 1996 by American web entrepreneurs Brewster Kahle and Bruce Gilliat. The company’s name was chosen in homage to the Library of

Alexandria, drawing a parallel between the largest repository of knowledge in the ancient

world and the potential of the Internet to become a similar store of knowledge.

Alexa is a complete toolkit for website owners that gives you metrics, tools and analysis to

increase web traffic and succeed online. It offers you accurate traffic metrics, automated site

scans, SEO recommendations, and much more.

Features like
Uptime Monitor
Site Comparisons
Traffic Sources
Demographics
Benchmark with others
Site Audits
SEO Audits
SEM Insights

You can install alexa tool bar as a add on in IE/firefox/Chrome.

http://www.alexa.com/toolbar
https://addons.mozilla.org/En-us/firefox/addon/alexa-sparky/

Advertisements

Free web analytics tools

Google Analytics – powerful full featured analytics tool. Even allows you to track your ROI by

keyword for each AdWords ad position. Google AdWords also has internal split testing and

conversion tracking software & offers data integration with Google AdSense that you can’t get

with any other web analytics tool.
http://www.google.com/analytics

Google Website Optimizer – allows you to A/B split test landing pages and track how well Google

AdWords traffic converts.
http://services.google.com/websiteoptimizer/

Piwik – realtime open source web analytics program
http://piwik.org/

Open Web Analytics – similar to Piwik, but more lightweight. Also comes with the ability to

record the browser screen on user’s sessions.
http://www.openwebanalytics.com/

Site Meter – starts off as free, but charges for advanced features
http://www.sitemeter.com/

Stat Counter – starts off as free, but charges for advanced features and bandwith usage.
http://www.statcounter.com/

Webalizer – default log analyzer on many servers.
http://www.mrunix.net/webalizer/

Analog – default log analyzer on many servers.
http://www.analog.cx/

Awstats – another popular default log analyzer on many servers.
http://awstats.sourceforge.net/

Configuring Service Recovery

You can configure Windows 200* services to take specific actions when a service fails. For example, you could attempt to restart the service or run an application. To configure recovery options for a service, complete the following steps:

In the Computer Management console, connect to the computer whose services you want to manage.

Expand the Services And Applications node by clicking the plus sign (+) next to it, and then choose Services.

Right-click the service you want to configure and then choose Properties.

Select the Recovery tab.

Note: Windows 200* automatically configures recovery for some critical system services during installation.

You can now configure recovery options for the first, second, and subsequent recovery failures. The available options are

Take No Action

Restart the Service

Run a File

Reboot the Computer
Best Practice When you configure recovery options for critical services, you may want to try to restart the service on the first and second attempts and then reboot the server on the third attempt.

find service name and query for find the settings

>sc qc BDESVC
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: BDESVC
TYPE               : 20  WIN32_SHARE_PROCESS
START_TYPE         : 2   AUTO_START
ERROR_CONTROL      : 1   NORMAL
BINARY_PATH_NAME   : C:\windows\System32\svchost.exe -k netsvcs
LOAD_ORDER_GROUP   :
TAG                : 0
DISPLAY_NAME       : BitLocker Drive Encryption Service
DEPENDENCIES       :
SERVICE_START_NAME : localSystem

>sc qfailure BDESVC
[SC] QueryServiceConfig2 SUCCESS

SERVICE_NAME: BDESVC
RESET_PERIOD (in seconds)    : 900
REBOOT_MESSAGE               :
COMMAND_LINE                 :
FAILURE_ACTIONS              : RESTART — Delay = 60000 milliseconds.
RESTART — Delay = 60000 milliseconds.

Windows command to manage TimeZone

Use this command to set timezone:

tzutil /s “universal standard time”

To display the current time zone, use the /g parameter. For example:

tzutil /g
systeminfo | findstr  /C:”Time Zone”

To get a list of all available time zones, use the /l parameter. For example:

tzutil /l.

FTP Client for Internet Explorer

By default FTP wont work in IE, when you type in URL locator.This can be enable in registry.
Also enable options in Advance settings in IE

User Key: [HKEY_CURRENT_USER\Software\Microsoft\Ftp]
Value Name: Use Web Based FTP
Data Type: REG_SZ (String Value)
Value Data: Yes or No

System Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\URL\
Prefixes]
Value Name: ftp
Data Type: REG_SZ (String Value)
Value Data: ftp://

Click Tools | Internet Options.
Click the Advanced tab.
Under Browsing, check the box labeled Enable Folder View For FTP Sites.

Next, if you’re on a computer that’s behind a firewall, you’ll need to set up IE to use passive FTP:

Click Tools | Internet Options.
Click the Advanced tab.
Under Browsing, check the box labeled Use Passive FTP.

Note: You can use Windows explorer instead of IE for browsing FTP sites.

DCOMCNFG command utility

DCOMCNFG.EXE (DCOM Config) is a utility you can use to secure DCOM Objects you have created. Here shows , how can use this for to change access permissions.

Dcomcnfg

how to show the drive information using by command

Diskpart is a command-line hard disk partitioning utility.It can use create,delet partions and volumes.

Diskpart to convert a dynamic disk to a basic disk and vice versa
DISKPART> ?

Microsoft DiskPart version 5.1.3565

ADD         – Add a mirror to a simple volume.
ACTIVE      – Marks the current basic partition as an active boot partition.
ASSIGN      – Assign a drive letter or mount point to the selected volume.
BREAK       – Break a mirror set.
CLEAN       – Clear the configuration information, or all information, off the
disk.
CONVERT     – Converts between different disk formats.
CREATE      – Create a volume or partition.
DELETE      – Delete an object.
DETAIL      – Provide details about an object.
EXIT        – Exit DiskPart
EXTEND      – Extend a volume.
HELP        – Prints a list of commands.
IMPORT      – Imports a disk group.
LIST        – Prints out a list of objects.
INACTIVE    – Marks the current basic partition as an inactive partition.
ONLINE      – Online a disk that is currently marked as offline.
REM         – Does nothing. Used to comment scripts.
REMOVE      – Remove a drive letter or mount point assignment.
REPAIR      – Repair a RAID-5 volume.
RESCAN      – Rescan the computer looking for disks and volumes.
RETAIN      – Place a retainer partition under a simple volume.
SELECT      – Move the focus to an object.

Eg. DISKPART>list volume , list disk detail disk

To create a striped volume using a command line
1.Open a command prompt and type diskpart.

2.At the DISKPART prompt, type list disk. Make note of the number of the disk where you want to
create a striped volume.

3.At the DISKPART prompt, type create volume stripe [size=<size>]

[disk=<disknumber>[,[<seconddisknumber>,…]].

http://support.microsoft.com/kb/300415
http://technet.microsoft.com/en-us/library/cc732422.aspx

Rebuild WMI

WMI is the database that stores meta-information and definitions for WMI classes; in some cases the repository also stores static class data as well. If the Repository becomes corrupted, then the WMI service will not be able to function correctly.
In such time we need to rebuild repository .

Notr: Deleting and rebuilding the repository can cause damage to the system or to installed applications. Other steps should be taken first to eliminate other possibilities or to confirm we have repository corruption.

Location of he file
%windir%System32\Wbem\Repository

Errors
Unable to connect to root\default or root\cimv2 namespaces thru wbemtest. Fails returning error code 0x80041002 pointing to WBEM_E_NOT_FOUND
When we open Computer Management and Right Click on Computer Management(Local) and select Properties, you get the following error: “WMI: Not Found” or it hangs trying connect
0x80041010 WBEM_E_INVALID_CLASS
Trying to use wbemtest, it hangs

Re-register all of the dlls and recompile the .mofs in the wbem folder and re-registering WMI Service and Provider.

@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in (‘dir /b *.dll’) do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s

Ans reboot the machine and test WMI

How to varify
winmgmt /verifyrepository

Windows OLE32 error

How to Repair OLE32 DLL
The Ole32.dll is a crucial element of your operating system. The file is a part of the object linking and embedding technology, or OLE, which allows users to embed files and create hyperlinks within programs. If the Ole32.dll is damaged or erased, you will not be able to create links or insert pictures into any documents on your computer. Missing Ole32.dll files also prompt numerous pop-up boxes to inform you that the DLL is missing. The best way to repair this error is to replace the damaged Ole32.dll.

Instructions

1
Visit a website that lets users download free copies of the Ole32.dll. Click on the link to download the file and save it to the desktop for easy access.

2
Go to “Start” > “Search” > “All Files and Folders” and type in “system32.” Hit “OK” to search for the folder that holds the vital DLL files of the system.

3
Drag the Ole32.dll file from your desktop into the “System32” folder. If it asks you if you want to replace the file, click “Yes.” The new file will overwrite the damaged Ole32.dll.

4
Go to “Start” > “Run” and enter “cmd” into the box. Hit “OK” to load the Command Prompt.

5
Type “regsvr32 ole32.dll” and press “Enter.” The new Ole32.dll will install itself onto your computer.

6
Type “exit” and hit “Enter” to close the Command Prompt.

7
Reboot your PC.

Steps to install MRTG

Step # 1 : Make sure snmp server installed
Please note that snmpd configuration does not require using mrtg with remote network devices such as Routers and switches. If you just want mrtg graphs for router or switch then please refer to step # 4 (as all these devices comes preconfigured with snmpd software).

Run rpm commands query option to find out snmp server installed or not:

# rpm -qa | grep snmp
If snmp installed then please refer step # 2; otherwise snmp server and utils were not present and your need to install them using following steps (login as a root user):

(a) Visit rpmfind.net to get snmp server and utilities rpms. If you are fedora user then use yum command as follows to install it:

# yum install net-snmp-utils net-snmp
(b) If you are RHEL subscriber then use up2date command as follows to install:

#up2date -v -i net-snmp-utils net-snmp

Step # 2 : Determine if snmp server is running or not
Run ‘ps’ command to see if snmp server is running or not:

# ps -aux | grep snmp
Output:

root   5512  0.0  2.3  5872 3012 pts/0    S    22:04   0:00 /usr/sbin/snmpd
Alternatively, you can try any of the following two commands as well:

# lsof -i :199
Output:

COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAMEsnmpd   5512 root    4u  IPv4  34432       TCP *:smux (LISTEN)
OR try out netstat command:

# netstat -natv | grep ‘:199’
Output:

tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN
If you found service is running or listing on port 199 then please see step #3; otherwise start service using following command:

# service snmpd start
Make sure snmpd service starts automatically, when linux comes us (add snmpd service):

# chkconfig –add snmpd

Step # 3 : Make sure snmp server configured properly
Run snmpwalk utility to request for tree of information about network entity. In simple words query snmp server for your IP address (assigned to eth0, eth1, lo etc):

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1
ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.0.3 = 2
If you can see your IP address then please proceed to step 4; else it is a time to configure snmp server as follows (by default RHEL and RH 8/9 are not configured for snmp server for security reason):

Configure SNMP
(1) Edit file /etc/snmp/snmpd.conf using text editor: # vi /etc/snmp/snmpd.conf
Change/Modify line(s) as follows:

Find following Line:

com2sec notConfigUser  default       public
Replace with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines: com2sec local     localhost           public
com2sec mynetwork 192.168.0.0/24      public
Scroll down bit and change:

Find Lines:

group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser
Replace with:

group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         mynetwork
group MyROGroup v2c        mynetwork
group MyROGroup usm        mynetwork
Again scroll down bit and locate following line:

Find line:

view    systemview     included      system
Replace with:

view all    included  .1                               80
Again scroll down bit and change:

Find line:

access  notConfigGroup “”      any       noauth    exact  systemview none none
Replace with:

access MyROGroup “”      any       noauth    exact  all    none   noneaccess MyRWGroup “”      any       noauth    exact  all    all    none
Scroll down bit and change:

Find lines:

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root  (configure /etc/snmp/snmp.local.conf)
Replace with (make sure you supply appropriate values): syslocation Linux (RH3_UP2), Home Linux Router.syscontact Vivek G Gite <vivek@nixcraft.com>
For your convenient, here is my /etc/snmp/snmpd.conf file. Feel free to use this file. Make sure you make backup of your existing file if you use this file as it is.

Start your snmp server and test it:

(a) Make sure when linux comes up snmpd always starts:

# chkconfig snmpd on
(b) Make sure service start whenever Linux comes up (after reboot):

# service snmpd start
(c) Finally test your snmp server:

# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex

Step # 4 : Install mrtg if not installed
Mrtg software may install during initial installation; you can verify if MRTG installed or not with following RPM command:

rpm -qa | grep mrtg
If mrtg already installed please see step # 5; else use rpmfind.net to find MRTG rpm or up2date command to install MRTG software:

# up2date -v -i mrtg
Fedora Linux user can use yum command as follows to install MRTG:

# yum install mrtg

Step # 5 : Commands to Configure mrtg
(a) Create document root to store mrtg graphs/html pages:

# mkdir -p /var/www/html/mymrtg/
(b) Run any one of the following cfgmaker command to create mrtg configuration file:

#cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg.cfg public@localhost
OR (make sure your FQDN resolves, in following example i’m using rh9.test.com which is my router FQDN address)

# cfgmaker –global ‘WorkDir: /var/www/html/mymrtg’ –output /etc/mrtg/mymrtg1.cfg public@rh9.test.com
(c) Create default index page for your MRTG configuration:

# indexmaker –output=/var/www/html/mymrtg/index.html /etc/mrtg/mymrtg.cfg
(d) Copy all tiny png files to your mrtg path:

# cp -av /var/www/html/mrtg/*.png /var/www/html/mymrtg/

Step # 6 First test run of mrtg
(a) Run mrtg command from command line with your configuration file:

# mrtg /etc/mrtg/mymrtg.cfg
Note: You may get few warning message for first time; ignore them.

(b) Fire your favorite web browser (like FireFox 😀 ) and type url http://www.your.com/mymrtg/ or http://your-ip/mymrtg/

Step # 7 Create crontab entry so that mrtg graph / images get generated every 5 minutes
(a) Login as a root user or login as a mrtg user and type following command:

# crontab -e
(b) Add mrtg cron job entry to configuration file (append following line to it):

*/5 * * * * /usr/bin/mrtg /etc/mrtg/mymrtg.cfg –logging /var/log/mrtg.log
Save file and you are done with MRTG config issues 🙂

Step # 8 Block ports 161 & 162 at firewall
You do not want to give access to everyone to your snmp server for security reasons. SNMP server uses UDP 161, 162 ports for communication. Use Linux IPTABLES firewall to restrict access to SNMP server

(a) Allow outgoing SNMP server request from your Linux computer. This is useful when you query remote host/router (replace SERVER IO with your real IP):

SERVER=”xxx.xxx.xxx.xxx”
iptables -A OUTPUT -p udp -s $SERVER –sport 1024:65535 -d 0/0 –dport 161:162 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -s 0/0 –sport 161:162 -d $SERVER –dport 1024:65535 -m state –state ESTABLISHED -j ACCEPT
(b )Allow incoming SNMP client request via iptables. This is useful when you wish to accept queries for rest of the world (replace SERVER IP with your real IP):

SERVER=”xxx.xxx.xxx.xxx”
iptables -A INPUT -p udp -s 0/0 –sport 1024:65535 -d $SERVER –dport 161:162 -m state –state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -s $SERVER –sport 161:162 -d 0/0 –dport 1024:65535 -m state –state ESTABLISHED -j ACCEPT
Pleae note that above two are just SNMP specific iptables rules. Please consult iptables(8) man page for complete information on iptables

Step # 9 Optional: Protect your MRTG graphs/html pages with password protected directory
Once again, you would like to restrict access to your MRTG reports. This can easily accomplished with Apache webserver’s .htaccess file. If you are on webhosting server with control panel (such as ensim or plesk) then you can use control panel itself to create password-protected directory.

Below is process outlined to protect graphs using apache’s .htaccess file and htpasswd command:

Step # 1: Create .htaccess file in /var/www/html/mymrtg/ directory (add text as follows):

vi /var/www/html/mymrtg/.htaccess
Add following text to file:

AuthName “MRTG Graphs/Html restricted access”
AuthType Basic
AuthUserFile /var/members/.htpasswd
require user mrtgadmin
Step # 2: Create a user and password name (-c assumes first time you are using .htpasswd file):

# htpasswd -c /var/members/.htpasswd mrtgadmin

%d bloggers like this: