Tuesday, 27 November 2012

Running Scripts from EM12C

There is probably a better way of doing this, but I’m going to start with the hard way and then hopefully make it better as I go.

I want a simple script to run a command and email me the results – cool.

I need to ensure that email is going to work from my hosts, so this is editing the /etc/mail/sendmail.mc

dnl define(`SMART_HOST', `smtp.your.provider')dnl


define(`SMART_HOST', `smtp.nsw.exemail.com.au’)dnl

some more hacking in this file, this was handy:  http://www.phase2.net/2007/03/sendmail-on-rhel-40-without-dns/

then try and run make from /etc/mail on my OEL 5 machine, get:

[root@E1ENT2 mail]# make
WARNING: 'sendmail.mc' is modified. Please install package sendmail-cf to update your configuration.
WARNING: 'submit.mc' is modified. Please install package sendmail-cf to update your configuration.

need to install some packages

Follow instructions on public yum server:  http://shannonscncjdeblog.blogspot.com.au/2012/06/public-yum-server.html sweet

yum search *send*

[root@E1ENT2 mail]# yum search *send*
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
======================================================= Matched: sendmail.cf ========================================================
sendmail.x86_64 : A widely used Mail Transport Agent (MTA).
sendmail-cf.x86_64 : The files needed to reconfigure Sendmail.

ok, now


now restart sendmail

service sendmail restart

Great, so now we can script and get emails that things are being done, nice!

mail -s test name@domain.com < /dev/null 2>&1 >> /dev/null
See from above, we can send files to ourself!
So, a script to restart JDE, ohh – so many ways!
I decided on the following

if [ $USERNAME = 'jde91' ]
    #we are JDE
    $EVRHOME/system/bin32/EndOneWorld.sh > /tmp/EndOneWorld.out
    sleep 15
    $EVRHOME/system/bin32/RunOneWorld.sh >> /tmp/EndOneWorld.out
    sleep 15
    ps -ef |grep jdenet >> /tmp/EndOneWorld.out
    porttest JDE XXXXX DV910 >> /tmp/EndOneWorld.out
    df -k >> /tmp/EndOneWorld.out
    mail -s 'E1 restart complete'  shannon.moir@myriad-it.com < /tmp/EndOneWorld.out 2>&1 >> /dev/null
    echo "File not there"

This was saved, then in created an EM12C job to run it.  This was running at jde91


. /home/jde91/.bash_profile; $EVRHOME/system/bin32/restartJDE.ksh




AS/400 monitoring and replacement variables

System Monitor Replacement Variables:

Parameter Passed Data
&DATE The Date the monitor triggered or reset
&INTVL Collection interval: How often the monitor collected data (in seconds)
&MON The Monitor name
&RDUR Reset duration: How many intervals does the reset value have to be met before the monitor resets.
&RVAL Reset value: The value that the metric was monitoring for when the monitor reset
&SEQ Sequence number: A unique, incrementing number assigned to each collection interval. Can be used in a
program to compare when triggers happened and in what sequence.
&TDUR Trigger duration: How many intervals does the trigger value have to be met before the monitor triggers
&TIME The time the monitor triggered or reset
&TVAL Trigger value: The value that the metric was monitoring for when the monitor triggered
&VAL Current value: The actual value of the metric when the monitor triggered (2)

Job Monitor Replacement Variables:

Parameter Passed Data
&DATE The Date the monitor triggered or reset
&INTVL Collection interval: How often the monitor collected data (in seconds)
&MON The monitor name
&TIME The time the monitor triggered or reset
&ENDPOINT The endpoint system name
&EVENTTYPE Event type: The type of trigger or reset that is happening, defined as follows:
Triggered Event = 1
Auto Reset Event = 2
Manual Reset Event = 3
&JOBNAME The job name of the job causing the trigger/reset
&JOBNUMBER The job number of the job causing the trigger/reset
&JOBSTATUS The job status causing a trigger/reset
&JOBTYPE The job type of the job causing the trigger/reset
&JOBUSER The job user of the job causing the trigger/rese
&NUMCURRENT Current numeric value
&NUMRESET Threshold value to cause auto-reset of numeric metric
&NUMTRIGGER Threshold value to cause trigger of a numeric metric
&OWNER Monitor owner
&RDUR Reset duration, in intervals, as set in the threshold
&RESETTYPE Reset type and defined as follows:
Manual reset = 1
Automatic reset = 2
&SBS Subsystem of the job causing the trigger/reset
&SERVER Server type of the job causing the trigger/reset.
Note: Not supported for summary metrics.
&TDUR Trigger duration, in intervals, as set in the threshold
&THRESHOLD Threshold number causing the trigger
&MSGID Message ID causing the trigger/reset
&MSGSEV Message severity causing the trigger/reset
&MSGTYPE Message type causing the trigger/reset

Wednesday, 21 November 2012

Moving a site from IIS6 to IIS7

You’ll need to install Web Deployment Tool 1.1 on the source.  You might be able to get it here

Open the IIS6 console and you’ll see the apps installed


Use the Identifier column in the following command to view the dependencies

Start a “Web Deploy Command Line”


Make sure you are admin

msdeploy -verb:getDependencies –source :metakey=lm/w3svc/1300211504

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:getDependencies -source
      <dependency name="AnonymousAuthentication" />
      <dependency name="WindowsAuthentication" />
      <apppoolInUse name="ADAuthDV" definitionIncluded="False" />
C:\Program Files\IIS\Microsoft Web Deploy>

Then you can save it off with

msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\Site1.zip

If you are unlucky like me, you might need to add a password to the zip

Info: Adding child cert (MY\7D9D8D6756DAEB3B205D5C03250BB95DD4A70C39).
Error: The property 'blob' located at '/metaKey[@path='/lm/w3svc/1300211504']/me
taProperty[@name='SSLCertHash']/cert' is marked as secure. You must specify an e
ncryption password to archive this property.
Error count: 1.

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync -source:metakey=lm
/w3svc/1300211504 -dest:package=c:\ADAuthDVLogin.zip,encryptPassword=P@ssw0rd99

Note the comma for the encryptPassword option

Copy them to your destination machine (2008R2 for IIS 7.5 in my situation)

You need to install the

“web platform installer” from http://www.iis.net/downloads

Install it, and then start IIS and you’ll see


Double-Click this and then choose products tab

Install the web deploy3 package


Restart IIS and you’ll now have import and export functionality


You need to import (note that you need to be one your machine name and use the “import server or site pacakge” option

Choose your zip file that you exported (Enter your password if you had one)

I also had to mess around with the application pool settings and edit the web.config files, but eventually it all started working.

Tuesday, 20 November 2012

using WAS on your 400–httpd.conf config for E1

If you are installed JAS on your 400, remember that you need to follow the instructions on the screen.  If it says “follow what is in the readme.txt”, things are not going to work unless you do it.

Please perform the following manual steps.

1. Add the following text to the Managed Instance's associated HTTP Server's httpd.conf file.

# The following configuration was added by the EnterpriseOne Server Configuration Framework

<VirtualHost *:9085>
Alias /jde "/QIBM/UserData/WebSphere/AppServer/V7/ND/profiles/default/installedApps/HDRYDOW/WAS7_DV_85.ear/webclient.war"
<Directory "/QIBM/UserData/WebSphere/AppServer/V7/ND/profiles/default/installedApps/HDRYDOW/WAS7_DV_85.ear/webclient.war/WEB_INF">
Order Deny,Allow
Deny from All
<Directory "/QIBM/UserData/WebSphere/AppServer/V7/ND/profiles/default/installedApps/HDRYDOW/WAS7_DV_85.ear/webclient.war">
Order Deny,Allow
Allow from All

2. Restart the Managed Instance's associated HTTP Server to pick up the changes.



Extra note for AS/400 monitoring

Changes to management central configuration (i.e. when we ask it to automatically restart failed monitors) only take affect once the management central services are restarted:

This can be done with:

  1. In iSeries™ Navigator, expand My connections > System A > Network > Servers > TCP/IP.
  2. Right-click Management Central and select Stop. Wait until the Management Central server has stopped. Press F5 to refresh the screen and view the status in the right pane. The status should display Stopped when the server has stopped.
  3. Right-click Management Central and select Start. This will restart the Management Central servers on the Central System.
  4. Repeat steps 1-3 on the target systems: System B, System C, and System D.

Note that it’s a TCP/IP server, so you can do it with STRTCPSVR *MGTC

Note that this was a helpful article too http://www.mcpressonline.com/system-administration/general/automatically-restart-failed-monitors.html

I did not do this in anger, but assume that it’s not going to affect anything.  I’d probably do it after hours the first time, just to be sure.

This shows that because TCPIP is ended for the backup, this is the reason that the management service is restarted when TCP is:



Monday, 19 November 2012

proactive AS400 monitoring–out of the box

I have a client that wants to do some more pro-active monitoring of their AS/400.  They want to know if something has failed before their users tell them – innovative!  Different!  Forward thinking!  Let’s be honest, if you read the doco, there are never any problems on an AS400 and this is a waste of time – but maybe not!

I did a little bit a research and I’m amazed what is available “out of the box”.  With some smarts about what to do and how JDE works on the AS/400 – monitoring is fairly easy.

There are 5 main categories of monitoring:


These are available from your “Management Central” location within the system I navigator.

What are you going to monitor, here is a start:

  • Disk usage
  • CPU usage
  • Errors in certain job logs (wow, this is GREAT) [tell me if I get
  • Errors in QHST log file, errors in any log file
  • Message in queues

All very possible given the above frame work.  You can just right click and start adding them.  We have our AS400 sending emails when certain disk, CPU thresholds are met.  We have it sending emails when backups are complete and also if there are certain messages in QHST (



Note that I look at what is available (with Graph history), and then add monitors for things that I want to monitor


You can use a file monitor to notify you whenever a selected file has changed,reached a specified size, or for specified text strings.

QHST for any system problems (CPF1124 – Job start)

JDE log files for specific messages / text strings


Check jobs for certain messages in job logs

Check existence of jobs, CPU usage of job, count of jobs, thread count etc.

If a UBE is killing the system, you could actually give it lower priority – this is POWERFUL!

You could move a job out of a queue if it was taking too long, this is VERY powerful (with the use of replacement variables)


Monitor for messages in a single message queue.


If your monitors are not auto starting

Restarting failed monitoring on the 400

you can manually select the option for “Restart on failed systems” – but this is a pain.  Fix the problem permanently!


Then choose “Connection”




In my research found the following helpful:


System iSystems Management Working with Management Central monitors Version 5 Release 4

This was also a VERY good presentation http://www.lisug.org/presentations/Monitoring%20System%20Performance%20Sept2012.pdf