Setting up HP Nonstop OpenSSH (ITUG OpenSSH distribution)

Posted by faizel isaacs on June 5th, 2009 filed in HP NonStop Application Support
Comments Off

http://nonstop-sysadmin.blogspot.com/2008/08/installing-openssh-on-nonstop.html

 

 

 

RESOURCES:

 

HP Nonstop E-Services portal
https://onepoint.nonstop.compaq.com/

International Tandem Users Group
ITUG

HP Nonstop newsgroup
Tandem newsgroup

Bowden Systems Inc (ISV with some free utilities available)
http://www.bsi2.com/

 

 

Setting up OpenSSH on Nonstop (ITUG OpenSSH distribution)

Notes:
1. Tested on H06.10
2. Keyboard interactive authentication does not work

Obtain the following 2 packages from the ITUG software library
prngd-0.9.27
openssh-3.7.1p2

- Install “prngd”

cd /tmp
uncompress nse-prngd.tar.Z
tar xvf nse-prngd.tar
cp prngd /usr/local/bin
mkdir -p /usr/local/etc/prngd
cp ./contrib/NONSTOP_KERNEL/prngd.conf /usr/local/etc/prngd/prngd.conf
mkdir -p /usr/local/var/run

- Make sure “$ZPLS” is started

gtacl -c ’scf status server $zpmon.#zpls’

- Create a start script for prngd

cat /usr/local/bin/start-prngd
#!/bin/sh
run nohup /usr/local/bin/prngd /usr/local/var/run/egd-pool temp.out&
sleep 10
exit

- Install OpenSSH

cd /
uncompress nse-openssh.tar.Z
tar xvf nse-openssh.tar

- Generate host keys.

ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N “”
ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N “”
ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N “”

- As super.super, add group “floss”, user “floss.sshd”, and alias “sshd” to the system. Not too sure what this is for, just following the readme.

gtacl -p safecom
=add user floss.sshd, 42,16, password password
=add alias sshd, floss.sshd, password password
=freeze user floss.sshd
=freeze alias sshd
=exit

- As super.super, set ownership and permissions on “/usr/local/var/empty”.

touch /usr/local/var/empty
chown super.super /usr/local/var/empty
chmod 755 /usr/local/var/empty

- As super.super, set ownership and permission on “/usr/local/bin/ssh”.

chown super.super /usr/local/bin/ssh
chmod 755 /usr/local/bin/ssh
chmod u+s /usr/local/bin/ssh

- As super.super, set contents, ownership and permission on
“/usr/local/etc/sshd_config”.

vi /usr/local/etc/sshd_config
> Change PasswordAuthentication to no.
> Change UsePrivilegeSeparation to no.
chown super.super /usr/local/etc/sshd_config
chmod 644 /usr/local/etc/sshd_config

- As super.super, set contents, ownership and permission on
“/usr/local/etc/ssh_config”.

vi /usr/local/etc/ssh_config
> Change RhostsAuthentication to yes.
> Add UsePrivilegedPort to yes.
chown super.super /usr/local/etc/ssh_config
chmod 644 /usr/local/etc/ssh_config

- Prepare a start script for sshd

cat /usr/local/sbin/start-sshd
#!/bin/sh
run nohup /usr/local/sbin/sshd temp.out 2>temp.out &
sleep 10
exit


HP Nonstop (Installation instructions for PHP)

Posted by Faiz on June 5th, 2009 filed in HP NonStop Application Support
Comment now »

Installation instructions for PHP 4 on an HP Nonstop Server

 

Those instructions are for installing PHP 4 on an HP Nonstop Server only. They are not valid for any other operating system.

 

This note also replaces the standard PHP 4 installation file for HP Nonstop Servers.

 

Considerations

 

PHP 4 can be run on an HP NonStop Servers as a CGI program, launched by the iTP Webserver. This installation note does not allow PHP to run as a module or as a specific Pathway server. Although this installation has been tested by HP employees, it is not supported by HP and the GCSC (NonStop Servers support center) will not enter cases for PHP issues.

 

If you would like support for PHP running on an HP Nonstop server, please enter a bug report in http://bugs.php.net, and specify the operating system version (e.g. HP Nonstop Server G06.13)

 

Versions

 

This installation procedure has been tested successfully on G06 and D48 systems.

 

Installation

 

  1. Unpack the distribution file.You will have downloaded a tar.gz file (not the bz2 file). For example php-4.2.1.tar.gz. Place the file in the top directory where you want to install php. For example: /home/dev/php

    Unzip this file like this:

    gunzip php-4.2.1.tar.gz

    This will create a file called php-4.2.1.tar. Untar the file:

    tar –xvf php-4.2.1.tar

    This will create a php-4.2.1 directory. Change directory to php-4.2.1:

    cd php-4.2.1

  2. Create a directory called nsk and go in the directory:mkdir nsk
    cd nsk

  3. The c89 compiler on HP Nonstop Servers do not automatically search for procedures in the system libraries when a file is being compiled. This causes a problem with the standard ./configure script, which will behave incorrectly, thinking that every procedure it is looking for exists on the system. This behavior is due to the fact that the linking of system procedures is made the first time the program is ran (called fixup time). If you do not use the script below, you will get undefined externals and illegal instructions when you run PHP, even though the compilation may have completed without errors.The script below gathers procedure names from the system SRLs, and creates a wrapper for the C compiler that will get around the problem described above.

    Note that although this script can be used to install other open source software that is built via Autoconf, it has been specifically tested for PHP, and there is no guarantee that it will work for other programs.

    Create a file called makeprocs which will contain the following script:

    #!/bin/sh

 

echo “\nStarting to build the procedure list from your system..\n”

 

# First get the current sysnn

 

sysnn=$(gtacl -p ’sysinfo’ | grep SYSnn | awk ‘{print $3}’)

 

echo “You are running on $sysnn.”

 

# Get the list of SRLs to look for. This is libc.obey

 

srllist=$(sed ’s/-l//’ </usr/lib/libc.obey)

srllist=”$srllist TSYSCLR”

 

# For each srl, call nm to extract the procedure names, and store that

# in a file.

# The grep and sed commands remove the extra information and just keep

# the procedure names. The last sed command changes the OSS_xxx_ proc names

# to xxx (e.g. OSS_gethostbyname_ to gethostbyname).

 

for srl in $srllist; do

  fullname=”/G/SYSTEM/$sysnn/$srl”

  echo “Extracting info from $fullname…” >&2

  nm $fullname | egrep ‘(^_EXP#)|(^_ORG#)|(^\$m_)’ | sed ’s/\([^ ]*\).*/\1/p’ \

     | sed ’s/^_EXP#//’ | sed ’s/^_ORG#//’ | sed ’s/^OSS_\([a-z]*\)[_]/\1/’

done >procs

 

echo “Done.. Now creating nskcc..”

 

# Now make a fake cc so that the Configure script will work properly. I call

# it ‘nskcc’, then set the following environment variables. After this is

# done, ./Configure and the subsequent make will run properly.

#

# CC=nskcc

# CPP=”c89 -E” Note that this means C preprocessor, not the Cplusplus compiler.

# CPPFLAGS=”-D_XOPEN_SOURCE_EXTENDED=1 -Wextensions -Wnowarn=1506,262,707,304″

 

# Remove our previous test file if any.

# launch the c compiler with the options given by the caller.

 

cat >nskcc <<EOM

#!/bin/sh

 

# first check if this is a test run

if [ "\$1" = "-test" ]

then

   test=true

   shift

fi

 

# See if we’re called from configure. If not, just run the c compiler

# otherwise do the procedure check

 

PARENT=\$(ps -p\$(ps -p\$\$ -oppid=”") -oargs|tail -1)

if test “\$test” = “true” || echo \$PARENT|grep -q ‘[cC]onfigure’

then

rm -f nskt

 

# Look for the name of the object file.

 

obj=\`echo \$* | sed ’s/.*-o \([A-Za-z0-9.]*\) .*/\1/’\`

 

# Try the compilation. Return immediately if failed.

 

c89 \$* || exit \$?

 

# if a procedure is undefined, it will appear like this:

# (none)    : gethostbyname

#

# use grep/sed to extract the procedure names that are undefined.

# we FAIL if there is one procedure undefined, even if the other is

# good. ./configure will rarely check more than one proc at a time

# so that should work 99%.

 

noft “file \$obj;llf” 2>/dev/null | grep “^(none)” | sed ’s/^(none)[ ]*: //’ >nskt

 

# if nskt is not empty, then there is a procedure that was not found in

# the srl, either because it was not declared properly, or because it’s

# in the tsysclr. In that case, try to find our procedure in the procs file.

#

# If the procedure is not found, exit with status 1. That way, ./configure will

# think cc failed and consider the procedure to not work.

 

if test -s nskt; then

   proclist=\`cat nskt\`

   for proc in \$proclist; do

      grep -q “^\$proc\\\$” \$PROCSFILE || exit 1

   done

fi

else

# script called from something else than configure, so just run c89.

c89 \$*

fi

exit

EOM

chmod +x nskcc

 

# Now tell user to set the env variables so ./configure uses our nskcc program.

 

echo “Now set the following environment variables and run ./configure.”

 

echo “export PATH=\$PATH:./nsk (or the full path of nsk)”

echo “export CPP=\”c89 -E\”"

echo “export CC=nskcc”

echo “export PROCSFILE=”

echo “export CPPFLAGS=\”-D_XOPEN_SOURCE_EXTENDED=1 -Wextensions -Wnowarn=1506,262,707,304\”"

echo “export LD=nld”

 

echo “Now run ./configure”

exit

 

  1. Execute the script. This will load the SRL information, and create two new files in the nsk directory:chmod +x makeprocs
    ./makeprocs

    You should see an equivalent to the following output:

    Starting to build the procedure list from your system..

 

You are running on SYS00.

Extracting info from /G/SYSTEM/SYS00/zcresrl…

Extracting info from /G/SYSTEM/SYS00/zcrtlsrl…

Extracting info from /G/SYSTEM/SYS00/zossksrl…

Extracting info from /G/SYSTEM/SYS00/zossfsrl…

Extracting info from /G/SYSTEM/SYS00/zsecsrl…

Extracting info from /G/SYSTEM/SYS00/zi18nsrl…

Extracting info from /G/SYSTEM/SYS00/zicnvsrl…

Extracting info from /G/SYSTEM/SYS00/zossesrl…

Extracting info from /G/SYSTEM/SYS00/zinetsrl…

Extracting info from /G/SYSTEM/SYS00/zstfnsrl…

Extracting info from /G/SYSTEM/SYS00/zosshsrl…

Extracting info from /G/SYSTEM/SYS00/TSYSCLR…

Done.. Now creating nskcc..

Now set the following environment variables and run ./configure.

export PATH=$PATH:./nsk (or the full path of nsk)

export CPP=”c89 -E”

export CC=nskcc

export PROCSFILE=

export CPPFLAGS=”-D_XOPEN_SOURCE_EXTENDED=1 -Wextensions -Wnowarn=1506,262,707,304″

export LD=nld

Now run ./configure

 

  1. You should then have the following files in the nsk directory:makeprocs nskcc procs

    The makeprocs file is the script you just ran.
    nskcc is the c89 wrapper.
    procs is a list of system procedures.

  2. Set the following environment variables:export PATH=$PATH:/home/dev/php-4.2.1/nsk (assuming that you installed php in /home/dev/php-4.2.1)
    export CPP=”c89 –E”
    export CC=nskcc
    export PROCSFILE=/home/dev/ph-4.2.1/nsk/procs (assuming that you installed php in /home/dev/php-4.2.1)
    export CPPFLAGS=”-D _XOPEN_SOURCE_EXTENDED=1
     –Wextensions –Wnowarn=1506,262,707,304”
    export LD=nld

    The PATH variable will tell make where to find the c89 wrapper (nskcc).
    The CPP variable stands for C PreProcessor. Those are the flags needed to run the preprocessor.
    CC is set to nskcc, which is our c89 wrapper.
    PROCSFILE should point to the file “procs” that was created after you ran makeprocs.
    CPPFLAGS are the c89 compiler flags. They specify that part of the source is XOPEN compliant, and some XOPEN header files should be included, Wextensions is necessary for TAL headers, and some warnings have been suppressed from the output as they should not cause any problem with this installation.

  3. Run the ./configure script.
    cd ..
    ./configure –without-mysql –host=nsr-tandem-nsk
    mysql is built by default on other PHP platform. Since mysql is not available on HP Nonstop Servers, it has to be disabled.This installation does not include non standard, experimental or platform specific extensions. If you wish to include specific extensions, they may not compile correctly on HP Nonstop Servers. Look for future revisions of this note as extensions are tested on HP Nonstop Servers.

    You may want to install PHP in a different directory that the default one, or enable/disable configuration options like short tags, safe mode, etc.. Look at http://www.php.net/manual/en/install.configure.php for a list of configuration options that you can change.

    When you run ./configure you should see the following after the first 10 lines or so:

    checking how to run the C preprocessor… c89 –E
    checking for gcc… nskcc

    If ./configure fails and doesn’t show that it is using nskcc or c89, check that your environment variables are set correctly.

    Continue reading the output of configure until it says “Running system checks”.  Few lines later, you may notice that it says that it didn’t find ieeefp.h. This is normal and should not be changed.

    Verify that asctime_r returns no. If you fall into INSPECT, you didn’t set the environment variables correctly, and the wrapper is not used, or it’s not working properly.

    Verify that gethostbyaddr returns yes. If it does, then everything is fine. If it returns no, then you have not installed the wrapper correctly.

  4. Once the configuration is over, you can now compile php. Just type make.
    You will see some warnings (mostly warning # 770). Those are okay, and won’t prevent PHP from compiling successfully.

  5. At the end of the compilation process, you should have a php object in the main php-4.2.1 directory. Check that it compiled okay without undefined externals:./php –v

    This should return:

    4.2.1 (or the version that you installed).

  6.  Install PHP
    make install

  7. Configure iTP Webserver to run php
    cd to /usr/tandem/webserver/conf
    edit the mime-types.config file
    add the following entries:MimeType application/x-httpd-guardian php
    PathwayMimeMap php generic-cgi

     

  8. Restart the iTPWebserver
    You can now test a simple php script:#/usr/local/bin/php
    <?php
    phpinfo();
    ?>


Building with extensions:

This installation note has not been tested with additional extensions. Some extensions are known to be working well on HP NonStop Servers, some need some tweaking before a full compilation can be achieved. Future versions of this note may include information on extensions that have been compiled successfully and run well on NonStop Servers.

 

Pathway, NSK architecture, Enscribe, SQLMP/MX and other HP NonStop Server specifics with PHP:


This installation note explains how to install and run PHP under Pathway as a CGI server. PHP does not take advantage of the NSK architecture, and will not be able to access SQLMP, Enscribe or other HP Nonstop Servers proprietary code. However, an Enscribe extension is being developed that will allow you to open, read, write and create enscribe files. SQL/MX access via the unified ODBC interface should also be available in the end of 2002 or beginning of 2003.

PHP Performance on HP Nonstop Servers is being evaluated. Watch out for performance information in an update of this installation note.

 

Getting a PHP binary for HP Nonstop Servers.

 

This is not offered yet, but it should be available in the near future.

 

Running PHP under Apache on HP Nonstop Servers, or running PHP under Guardian

 

Apache has not been officially ported by HP on HP Nonstop Servers. The official webserver is iTPWebserver, which takes full advantage of the HP Nonstop technologies, including multiple cpus, load balancing, fault tolerance to name a few. iTPWebserver does not run


NSK FTAM (trace utilities)

Posted by faizel isaacs on April 5th, 2009 filed in HP NonStop Application Support
Comment now »

PTrace Reference for Tandem FTAM

PTrace formats the data that is stored in the unstructured trace files that you can create using the SCF TRACE command. These files contain records of the communications between processes.

 

TRACE and PTrace

The SCF TRACE PROCESS command and the PTrace utility, used together, help you

diagnose different problems that can occur in the operation of APLMGR, initiator, and

responder processes.

The TRACE command allows you to monitor the activities of the APLMGR, initiator,

and responder processes involved in the FTAM environment, including the user

application. You can initiate and terminate the gathering of trace information while these

processes are running.

You can use PTrace to format and display trace records captured by the TRACE

Command


HP NonStop FTAM (Trace utilities)

Posted by Faiz on April 5th, 2009 filed in HP NonStop Application Support
Comment now »

The NTL version of PTRACE

PTrace Reference for Tandem FTAM

PTrace formats the data that is stored in the unstructured trace files that you can create using the SCF TRACE command. These files contain records of the communications between processes.

 

TRACE and PTrace

The SCF TRACE PROCESS command and the PTrace utility, used together, help you

diagnose different problems that can occur in the operation of APLMGR, initiator, and

responder processes.

The TRACE command allows you to monitor the activities of the APLMGR, initiator,

and responder processes involved in the FTAM environment, including the user

application. You can initiate and terminate the gathering of trace information while these

processes are running.

You can use PTrace to format and display trace records captured by the TRACE

Command

 

The order in which TRACE commands and PTrace commands are given is important.

You must start and stop a trace before you use PTrace to view the collected trace

records; you must start PTrace before you can issue PTrace commands. The order is as

follows:

1. Start a trace using the SCF TRACE command.

The following example starts a trace of an initiator process named $FTI1 on the

MARS system, collects all record types, sets a trace record size of 4050, and writes

the collected trace records in the file $DATA.SYS00.TRACE01 on the same system:

TRACE PROCESS MARS.$FTI1 &

, SELECT ALL &

, RECSIZE 4050 &

, TO MARS.$DATA.SYS00.TRACE01

2. While the trace is running, perform the FTAM activity you wish to be recorded by

the TRACE facility.

3. Stop a trace using the SCF TRACE command.

The following example stops the trace started in Step 1:

TRACE PROCESS MARS.$FTI1, STOP

4. Start the PTrace utility using the SCF RUN command. The following is an example

of an explicit RUN command and the display header that is returned:

RUN DIAG.$SYSTEM.SYS00.PTRACE

PTrace - Trace Formatter - T9385D20 - (01JUN93) - (05APR93)

Copyright Tandem Computers Incorporated 1986-1993

You can also use an implicit RUN command to start PTrace, as follows:

PTRACE

 

5. Display selected trace records, using PTrace commands.

The following example displays the PROV and USER trace records from the trace

file specified in the earlier TRACE command:

FROM DIAG.$DATA.SYS00.TRACE01;SELECT(PROV,USER)

When using SCF TRACE and PTrace use the SELECT ALL option Then, when analyzing the trace file using PTrace, select only among the PROV, ASN1, and USER options. (The PROV,ASN1, and USER options have the most relevance for users; the others are primarily for use by your service provider.)

The following command collects information on all activity of the FTAM initiator

$FTM1 on the MARS system, sets a trace file record size of 2000 bytes, and stores the

trace in the file named TRACE01 on the same system:

TRACE PROCESS MARS.$FTM1, SELECT ALL &

, RECSIZE 2000 &

, TO TRACE01

When you have collected the data you want, use the following command to stop the

trace:

TRACE PROCESS MARS.$FTM1, STOP

When you have collected the data you want, stop the trace and start the PTrace utility, as

follows (using, in this example, an implicit RUN command):

PTRACE

PTrace - Trace Formatter - T9385D20 - (01JUN93) - (05APR93)

Copyright Tandem Computers Incorporated 1986-1993

After the PTrace product banner is displayed, issue the following PTrace command to

view the trace records for DSM and ASN1 encoding and decoding activity stored in the

TRACE01 file:

FROM TRACE01;SELECT(DSM,ASN1); RECORD ALL

In the above example, all record types were written to the trace file. Therefore, the DSM

and ASN1 keywords were used in the PTrace command to specify the specific record

types desired for display.

The following command collects information only about the PROV activity of the

FTAM initiator $FTM1 and stores it in the file named TRACE02:

TRACE PROCESS $FTM1, SELECT PROV, TO TRACE02, RECSIZE 2000

When you have collected the data you want, stop the trace and start the PTrace utility.

To view the PROV activity records stored in the TRACE02 file, use the following

PTrace command:

FROM TRACE02;SELECT ALL; RECORD ALL

In the above example, only PROV records were written to the trace file. Therefore, the

PROV keyword does not need to be repeated in the PTrace command. (You could also

omit the SELECT ALL since that is the default.)

You can collect information on DSM requests to and responses from the APLMGR

process by using the following SCF TRACE command:

TRACE PROCESS $AMGR, SELECT DSM, TO TRACE03, RECSIZE 2000

When you have collected the data you want, stop the trace and start the PTrace utility.

To view the trace records you have collected, use the following PTrace command:

FROM TRACE03;SELECT ALL; RECORD ALL

 

OSI/FTAM and OSI/APLMGR SCF Reference Manual—421943-001

5-10

Table 5-3 identifies the available FILTER options.

To display only trace records for the subdevice #Z123456 from the trace file TRACE01

on the system, use the following PTrace command:

FROM TRACE01;FILTER SU #Z123456

To display only records related to ASN.1 decoding, use the following PTrace command:

FROM TRACE01;SELECT ASN1;FILTER ASN1DEC

To display all provider records related to data transfer, use the following PTrace

command:

FROM TRACE01;SELECT PROV;FILTER PROV DATA

Table 5-3. FILTER Options for Initiator and Responder Process Traces

Option Description of Records Displayed

SU [su-name] Records containing the specific subdevice that you named.

PROV [primitive-type] PROV records containing the

primitive type that you

specify. Primitive-type

options and the primitives

that they include are

CONNECT

RELEASE

DATA

A-ASSOC-REQ,

A-ASSOC-IND,

A-ASSOC-RSP,

A-ASSOC-CNF,

A-ATTACH-REQ

A-ABORT-IND,

A-ABORT-REQ,

A-P-ABORT-IND,

A-RELEASE-REQ, A-RELEASE-

IND,

A-RELEASE-RSP,

A-RELEASE-CNF

P-DATA-REQ,

P-DATA-IND

Note. Multiple filter options cannot be issued in the same FILTER command


HP NonStop FTAM over IP (case Study)

Posted by faizel isaacs on February 3rd, 2009 filed in HP NonStop Application Support
Comment now »

1. Introduction

Interoperability of FTAM over IP and also why a native FTAM install is so complex if you
want to use it over TCPIP/LAN.

1.1 Scope of work.

Research interoperability of the OSI stack between a HP NonStop (TANDEM) operating system and a
SIEMENS RELIANT UNIX version 5.45 systems. Compliance to
ISO 8571, as well as RFC 1006
detailing Gateway specification for LAN and WAN Networks - x25 over the OSI Stack.

1.2 Research

There is a product on the market that incorporates FTAM over IP as a layerd product,
the software is called
OpenFT, and it does all the FTAM negotiation for you between
the receiver and responder, as well as translates Commnames (FTAM address /
DTE Address
- Digital Equipment Address), DNS lookups and translations, distinguishes between FTAM
profiles
and FT profiles so it is quite flexible.
Cisco also recently came out with a router
(XOT) that’s capable out doing the switch between X.25 and IP.
Also attached is a detailed RFC of what
needs to be in place and what needs to happen on your network for a native FTAM install over IP to be implemented successfully.

Most Unix platforms makes use of this product (ncopy).
The most common networks support by OpenFT are TCP?IP, NEA, ISO, SNA,
X.21/X.25, ISDN, GSM mobile telephony or MODACOM. X.25 or TCPIP transport medium.

1.3 Recommendation / Findings

The HP Nonstop Integrity or even S-Series (Tandem) is ISO compliant, but there’s a vast difference
in the set-up of the FTAM Initiator profile, TANDEM (HP Nonstop) runs on NonStop TCP/IP or PARALLELE TCPIP,
while the UNIX environment makes use of the local LAN or WAN network.
According to ISO standards for interoperability for two remote host to communicate the profiles
must at least be compliant on the lower lever since the OSI stack comprises of seven layers.
Also the Tandem Guardian file system got a limitation of eight character file names
while the UNIX environment is set to 256. The Software that run’s on the
TANDEM (HP Nonstop) only caters for FTAM
document type 1 and FTAM document type 3 files, while it needs to
act as the initiator (in my case study) of the FTAM transfer, the local HP Nonstop application would have to be modified to cater
for
NBS-9 FTAM.
Maximum throughput / clock speed is 35 mb per hour over x.25 while speeds of
up to 290 mb per hour can be easily achieved across TCP/IP.

The business application software that runs on top of the HP Nonstop should be modified to move off the Guardian file system
and onto the OSS environment on the HP Nonstop server.
By acquiring the OpenFT software these goals can be achieved easily,
or by connecting the HP Nonstop
SWAN concentrator to the Cisco XOT router into the X.25 cloud no application porting
is required as the Cisco XOT router interface would handle this switch for you seamlessly.

OpenFT comes with a GUI interface for building customize file transfer
applications (API), encryption and automated job scheduling,  so OpenFT give you the flexibility to port your legacy polling applications.

Whilst the Cisco XOT router would provide the business seamless integration without any application
porting needed on the HP Nonstop environment.

1.4 RFC

http://www.faqs.org/rfcs/rfc1006.html


Regular expression in Perl (how to replace a date string)

Posted by Faiz on February 1st, 2009 filed in Perl Support
Comment now »

In Perl you can replace a string easily, than your normal counterpart SED editor. With SED you would have to use the -e flag in order to edit the content of your data - then pipe it to a new output file and then finally rename the new output file the appropriate file name again. With Perl this becomes simple to do. All you do is use the Perl -i flag this is a Perl internal that will automatically create a backup of the original file you - all you do is give the backup file name extension. Look at my scripts first line.

Since this is hard coded routine, I have made the variables local to my routine followed by . Finally the reason behind my madness is simple, with Perl your code is portable i.e. I can execute this code on any machine with a Perl compile. Well that’s not 100% true, if I compile this code into a standalone binary I can run the exe on any machine. To do this download Active states perl2exe (this is not freeware) or use Cava Packager this is completely free. Once you compile this code you can distribute it (you got the option to compile it into an auto installer) and any user can run it on windows system without even having Perl locally on their machine. So with Perl you code really becomes portable no more coding for a specific Unix distribution or Windows flavor.
Code below!!!!!
============

#!/usr/bin/perl -i.bkup

use strict;
use warnings;

system(’clear’);

#Declare + Initialization;
#=========================

my $replace_OLD=’2008/02/03′;
my $replace_NEW=’2009/01/20′;
my $num_of_args = @ARGV;

# Print the usage out !!!!
#=========================

print “nnComment: Number of arguments is: $num_of_argsn”;

# Verify number of arguments if zero just exit!!!!
#=================================================

if ($num_of_args == 0)

{ print “nnERROR: No command line arguments passed to the script $0 n”;

print “USAGE: n”;
print ‘Example 1 : ./Replace_Dates.pl inputfile’,”n”;
print ‘Example 2 : ./Replace_Dates.pl /dsk1_app/sys1/*.DAT’,”n”;

exit;
}# END_if

# Now loop through those records !!!!
#=====================================

while () #Start reading in Data
{
s/$replace_OLD/$replace_NEW/g;
print;
} # END_while

print “nDONE. Script: $0n”;


Perl - Snmp (win32 - Process stats module)

Posted by faizel isaacs on January 11th, 2009 filed in Perl Support
Comment now »

The below Perl script one can quickly modify to look  at certain system processes via a windows schedule task. The below script incorporates SNMP traps so it will forward all related alerts to you enterprise management server. See below working example - here I’m checking is the MS SQL server agent (sqlagent.exe AND  sqlmangr.exe) is up and running at a given interval via a windows schedule task that runs every 15 minutes.!!!

#!/usr/bin/perl
#
# PROGRAM: Process.pl
# DESCRIPTION: Checks win32 Process Info
# HISTORY
# Ver   Date            Author  Description
# —-  ———–     ——- ————————————————–
# 1.0   11-Jan-2009     Faizel Isaacs   Script will Monitor any
#                                       Give Process on the
#                                       Windows Machine
#                                       And Forward SNMP
#                                       Alerts to Support Staff
#                                       If Process is no longer active
#                                       On system!!!
# —-  ———–     ——- —————————————————
# Calling all required PERL Modules Needed !!!

use Win32::Process::Info;
use Sys::Hostname;
$host = hostname;

my $pi = Win32::Process::Info->new ();

#===========================================
#== Cleaning Up Previous Temp Files !!! ==#
system(”del F:\Perl\Initial.list”);
system(”del F:\Perl\Refine.list”);
system(”cd F:\Perl”);
#===========================================

# Kicking of the Process Stats !!!

foreach $proc ($pi->GetProcInfo ()) {
    print “n”;
    foreach (sort keys %$proc) {
open(OUTPUT, ‘>>f:PerlInitial.list’) ||die “can’t write to the file called script_output: $1″;
        print OUTPUT “$_ => $proc->{$_}n”;
    
        }
    }
close(OUTPUT); # Closing my FileHandle
#==================================================
# Finish with My Process Stats Collection !!!
# Now we specify what we look for (Processes)
# And Filter to a output File I check Later
$pattern = “(sqlagent.exe|sqlmangr.exe|perl.exe|fazel.exe)”; #changes are done here on this line
#===================================================

system(”cd F:\Perl”);

 open(INPUT, ‘F:PerlInitial.list’) || die “can’t open the file called Initial.list: $1″;

open(OUTPUT, ‘>>F:PerlRefine.list’) ||die “can’t write to the file called Refine.list: $1″;

 while(<INPUT>)  {
  if ($_ =~(m/$pattern/g))    {
   print OUTPUT “$_ n”;

     }
    }

 close(INPUT); #Closing my FileHandle
close(OUTPUT); #Closing my FileHandle

#=============================================================
# Finish Capturing the list of Processes I’m interested IN
# Now we need to loop through them all to see what is running
# If a particular Process is not Found I will raise an Alert!!
#=============================================================
# Now I will go search through my
# Refine.list File for specific Prosses!!
#==============================================================

#================================
# Setting All Variables
# The Below Prc Variables
# I will Raise Alerts For
# If they not Active on the System
#================================
system(”cd F:\Perl”);
$Prc1 = “sqlagent.exe”;
$Prc2 = “sqlmangr.exe”;
$Prc3 = “FAIZEL”;

#=================================
# Will Call Windows Find Command
# For the Processes I’m after
# While searching through my
# Temp file f:PerlRefine.list
#=================================

$look1 = system(”find “$Prc1″ F:\Perl\Refine.list”);
$look2 = system(”find “$Prc2″ F:\Perl\Refine.list”);
$look3 = system(”find “$Prc3″ F:\Perl\Refine.list”);
print “This is my return code for $look1 n”;
#================================
# Now I’m Checking the System
# Return Code, if Code eq 256
# The Process is no longer
# Active on the system
#================================

 if ($look1 eq 256) {
system(”trapgen -d SNMP-HOST -o 2.4.7.2.5.2.4286 -g 6 -s 9 -v 2.4.7.2.5.2.4286.4 STRING “SYSTEM1 Procs ApplicationIDRIVE $Prc1 is not running on $host”");

  }
 if ($look2 eq 256) {
 
system(”trapgen -d SNMP-HOST -o 2.4.7.2.5.2.4286 -g 6 -s 9 -v 2.4.7.2.5.2.4286.4 STRING “SYSTEM1 Procs ApplicationIDRIVE $Prc2 is not running on $host”");

  }
 if ($look3 eq 256) {

system(”trapgen -d SNMP-HOST -o 2.4.7.2.5.2.4286 -g 6 -s 9 -v 2.4.7.2.5.2.4286.4 STRING “SYSTEM1 Procs ApplicationIDRIVE $Prc3 is not running on $host”");

  }


How to install Open SSH on win32 (XP)

Posted by faizel isaacs on January 11th, 2009 filed in SSH Support
Comment now »

  1. download OpenSSH from http://sshwindows.sourceforge.net
  2. Unzip it, and run the resulting installer
  3. Install the program to the directory of your choice (I will use c:OpenSSH).  You will be best served by putting OpenSSH into a directory that does not contain any spaces.
  4. Take the defaults for the remaining setup screens
  5. After OpenSSH is installed, open a command prompt and cd to the OpenSSHBin directory
  6. Run mkgroup -l >> ..etcgroup
  7. Run  mkgroup -d >> ..etcgroup
  8. Run mkpasswd -l [-u ] >> ..etcpasswd
  9. Run mkpasswd -d [-u ] >> ..etcpasswd
  10. Run “net start opensshd“
  11. On a seperate system equipped with an SSH client (such as PuTTY), ensure you can connect to the new server using a username and password that is valid for the server
  12. Once you have verified the OpenSSH service is working correctly, go ahead and “net stop opensshd“ to stop it
  13. From the command window on the server, cdopensshetc
  14. Copy sshd_config to sshd_config.bak just in case something goes horribly wrong and you want to return to the default configuration and start over
  15. cd ..bin
  16. Run “ssh-keygen -t rsa“ (we will be generating an SSH2 RSA key, which is the currently recommended key)
  17. When asked for where we want the key files to be placed, DO NOT TAKE THE SUGGESTED LOCATION.  Instead enter “/etc/id_rsa“ (the use of “/“ is important here, you cannot use ““)
  18. Enter a passphrase (you can leave the passphrase blank, but a passphrase will prevent the key from being used if someone happens to acquire it)
  19. Enter the passphrase a second time
  20. Observe two files being generated, “id_rsa“ (your private key, which your client machines will need) and “id_rsa.pub“ (your public key, which stays on your server)
  21. Run “cd ..etc“
  22. Perform a “dir“ and ensure the two files are there.  If they aren’t go find them and put them there.
  23. Run “copy id_rsa.pub authorized_keys“  The goal is to make a copy of the public key file, named “authorized_keys“
  24. Grab the other file (id_rsa) and copy it by whatever means necessary (network, floppy, usb flash disk, pigeon, whatever it takes) to the machine you will be using as the client.  (This file is your private key, and should be treated as highly confidential.  If you used a well-thought-out passphrase when generating the key, then it is nigh unusable if someone comes across it.  Otherwise, if someone gets a hold of this file, they can IMPERSONATE YOU when connecting to your SSH server.  Pass phrase or not, this file should be treated as sensitive, and erased from whatever media you used to move it to your client.)
  25. Run “net start opensshd“ and check in the Services applet that is has started and is running.
  26. On the client, assuming you have SSH client tools installed, you can run “ssh -l “ from the directory where the id_rsa file was copied, and it should prompt you for the pass phrase, if you entered on during key generation.  Once the pass phrase is entered, it should connect to the SSH server and give you a command prompt.


i-Drive-Technologies

Posted by faizel isaacs on December 21st, 2008 filed in HP NonStop Application Support, Mediation applications, Moodle Content Management, PHP Support, Perl Support, SSH Support
Comment now »

home-image1

i-Drive-Technologies is a
Cape Town base (SA) company that provides application

support services for the below XAMPP disciplines.
If 100% application availability is a must for you
get in touch with us!!

We have experience in HP NonStop application support
inclusive of Mediation telecoms support, Unix / Linux distributions.
We offer network file management tools
inclusive of SSH support for WIN32/ solutions.
HTML and PHP encryption software.
If you need to outsource any of your mission critical applications
Contact us.

 

 


Perl Support

Posted by Faiz on December 21st, 2008 filed in Perl Support, Uncategorized
Comment now »

We offer Perl support for Unix / Linux systems as well as win32


-