Strict Standards: Redefining already defined constructor for class wpdb in /var/www/myfoto.se/jbits.se/blog/wp-includes/wp-db.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 384

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 560

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 684

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/code-highlighter/codehighlighter.php on line 42
jbits.se » 2010 » February
Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/kses.php on line 627

jbits.se

Jörgen Björkmans blog

Archive for February, 2010

Feb
19

TcpDump - Output to file AND console

Posted by jbjorkman on February 19, 2010 under
Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-includes/formatting.php on line 82
Linux, Network

tcpdump -s 0 -i eth0 -c 10 -w - -U | tee capture.pcap | tcpdump -n -r -
Full packets are written to capture.pcap, at the same time tcpdump -r decodes the stream to console.

-s 0 (Whole packets)
-w - (Write output to console)
-U (Do not buffer output)

Feb
19

List local Useraccounts using ADSI

Posted by jbjorkman on February 19, 2010 under Powershell

[adsi]"WinNT://$env:COMPUTERNAME" | select -expand children | Where { $_.psbase.schemaclassname -eq 'user' } | ft Name,LastLogin, isAccountLocked -autoSize

Feb
16

Checkpoint SPLAT - Install & Configure HP Agents

Posted by jbjorkman on February 16, 2010 under Checkpoint, Linux, Network, OS


Preparations

Allow HP SMH (TCP2381) and SNMP to the modules from selected stations

Log in and create a temporary directory (e.g. /var/HPAgents)

Download the following packages from www.hp.com for your hardware / RHEL3

  • hpasm (System Health Application and Insight Management Agents)
    201002, latest version: hpasm-7.8.1-116.rhel3.i386.rpm
  • cmanic (HP NIC agent), and the optional
    201002, latest version: cmanic-7.7.0-5.rhel3.linux.rpm
  • hpsmh (System Management Homepage)
    201002, latest version: hpsmh-2.1.8-177.linux.i386.rpm

Download the splat_hpasm_support_files.tgz support files
http://www.opsec.com/solutions/partners/hpasm.html

 

Installing System Management Homepage (optional)

Login as expert on SPLAT and create the following file:
    echo "Red Hat Enterprise Linux ES release 3 (Taroon)" > /etc/redhat-release

Install the hpsmh package:
    rpm -ivh hpsmh-2.1.8-177.linux.i386.rpm

Install support files for HPASM

Extract the Splat hpasm supportfiles:
    tar xzvf splat_hpasm_support_files.tgz splat_hpasm

Copy the IPMI sysconfig file (If your system has an iLO2 Mgmt Controller)
    cp splat_hpasm/init_scripts/sysconfig_ipmi /etc/sysconfig/ipmi

Copy the IPMI init script for your kernel version (Check with uname –r)
    cp splat_hpasm/init_scripts/2.4_init_ipmi /etc/init.d/ipmi

Copy the libstdc++-3-libc6.2-2-2.10.0.so file to /usr/lib and set up a link
    cp splat_hpasm/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib
    ln -s /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so /usr/lib/libstdc++-libc6.2-2.so.3
    chmod 755 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so


Enable SNMP

Snmp service enable

Install HPASM

Remove any previous versions if present:
   
rpm -e hponcfg
    rpm -e cmanic
    rpm -e hprsm
    rpm -e hpasm

Install the HPASM package
    rpm -ivh hpasm-7.8.1-116.rhel3.i386.rpm

Install the NIC Agents
    rpm -ivh cmanic-7.7.0-5.rhel3.linux.rpm

Configuration

Backup your snmp config files
    cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf-pre-`/bin/date +%Y%m%d`
    cp /etc/snmp/snmpd.users.conf /etc/snmp/snmpd.users.conf-pre-`/bin/date +%Y%m%d`

For first time configuration run:
    hpasm activate

To reconfigure run:
    /etc/init.d/hpasm configure or /etc/init.d/hpasm reconfigure

Do you wish to continue? <y/n> (blank is y) y
Do you want to load the hp modules even though they may "taint" your kernel? <y/n> (Blank is y) n
Do you wish to use an existing snmpd.conf (y/n) (Blank is n):
n

Do you require SNMP agents (y/n) ? (Blank is y): y
Do you require Storage Agent support (y/n) ? (Blank is y):
y
Do you require performance agent support (y/n) ? (Blank is y): y

Enter the localhost SNMP Read/Write community string
(one word, required, no default):
********
Re-enter the same input to confirm:********

Enter localhost SNMP Read Only community string
(one word, Blank to skip):
********
Re-enter the same input to confirm:
********

Enter Read/Write Authorized Management Station IP or DNS name
(Blank to skip):
[Blank]

Enter Read Only Authorized Management Station IP or DNS name
(Blank to skip):
[Blank]

Enter default SNMP trap community string
(One word; Blank to skip):
[Blank]

Enter SNMP trap destination IP or DNS name
(One word; Blank to skip):
[Blank]

Enter system contact information
(Name, phone, room, etc; Blank to skip):
[Blank]

Enter system location information
Building, room, etc; Blank to skip):
[Blank]

Do you wish to disable hpsmh support (y/n) (Blank is n):n

Do you wish to keep CCISS device handle open (y/n): y

Restore snmpd.users.conf:
    mv /etc/snmp/snmpd.users.conf.bak /etc/snmp/snmpd.users.conf

Restart SNMP Daemon
    service snmpd restart

Feb
12

HP GbE2c Configuration Template

Posted by jbjorkman on February 12, 2010 under Network

/* ******** HP GbE2c Template Config ********
/* Replace the following strings with your own values:
/* $HOSTNAME$ - Switch Hostname
/* $SNMPRO$ - SNMP Read community
/* $SNMPRW$ - SNMP Write community
/* $UPLINKPORT$ - Your uplink port (eg 20)
/* $IPADDR$ - Switch IP Address
/* $IPMASK$ - Netmask
/* $IPBCAST$ - Broadcast
/* $IPGW$ - Gateway
/* $IPDNS1$ - DNS Server 1
/* $IPDNS2$ - DNS Server 2
/* $IPDOMAIN$ - DNS Domain name
/* $IPNTP1$ - NTP Server 1
/* $IPNTP2$ - NTP Server 2
/* ******************************************/* ------- Time Configuration -------
/c/sys/timezone 233 /* Set Timezone to Europe/Sweden
/c/sys/dlight e /* Enable Daylight saving

/* ------- SSH Configuration -------
/c/sys/sshd/on /* Enable SSH (Keys will be generated when config applied)

/* ------- BOOTP/DHCP Configuration -------
/c/sys
bootp dis
dhcp dis

/* ------- SNMP Configuration -------
/c/sys/ssnmp
name "$HOSTNAME$"
rcomm "$SNMPRO$"
wcomm "$SNMPRW$"

/* ------- UFD (Uplink failure detection) Configuration -------
/c/ufd/on
/c/ufd/fdp/ena
/c/ufd/fdp/ltm
addport $UPLINKPORT$
/c/ufd/fdp/ltd
addport 1
addport 2
addport 3
addport 4
addport 5
addport 6
addport 7
addport 8
addport 9
addport 10
addport 11
addport 12
addport 13
addport 14
addport 15
addport 16

/* ------- IP Configuration -------
/c/l3/if 256
ena
addr $IPADDR$
mask $IPMASK$
broad $IPBCAST$
/c/l3/gw 4
ena
addr $IPGW$
/c/l3/dns
prima $IPDNS1$
secon $IPDNS2$
dname $IPDOMAIN$

/* ------- NTP Configuration -------
/c/sys/ntp
on
prisrv $IPNTP1$
secsrv $IPNTP2$

/
script end /**** DO NOT EDIT THIS LINE!

/* ************** Additional Configuration Examples ******************

/* ------- Example User Configuration -------
/* /c/sys/access/user/uid 9
/* name "Username"
/* pswd "Password Hash"
/* ena
/* cos admin

/* ------- Example Port Configuration -------
/* /c/port 20
/* tag ena /* Enable tagging
/* pvid 255 /* trunk access vlan
/* /c/port 10
/* pvid 248 /* Access port on vlan 248

/* ------- Example VLAN Configuration -------
/* /c/l2/vlan 248
/* ena
/* name "Custom VLAN"
/* def 1 2 8 9 10 11 20

/* ------- Example Spanning Tree Configuration -------
/* Create unique stp groups for every vlan on the switch
/* /c/l2/stp 48/clear /* Create STP Group 48
/* /c/l2/stp 48/add 248 /* Add VLAN 248 to STP Group 48

Feb
12

NTP Time Synchronizing on Windows machines.

Posted by jbjorkman on February 12, 2010 under Windows

Use the following command to setup ntp time sync on a windows machine:
w32tm /config /manualpeerlist:"ntp1.example.com,0x8 ntp2.example.com,0x8" /syncfromflags:MANUAL
Note the 0x8 flag after the ntp server name, this is needed to set 'ntp client mode'.

Restart the Windows Time service:
net stop w32time & net start w32time

Forced resync:
w32tm /resync /rediscover

Check status:
w32tm /monitor