Lotus Domino: Redirect Console Output to file and run a shell

From Wiki

We will get output from console command "show stat" and run a shell

Create new file runstat.cmd inside of data directory and add the following commands:

Show Stat >runStatOutput.txt
Load runstat2.sh

Save and Close

Create new file runstat2.sh inside of data directory and add the following commands:

#!/bin/sh
SERVER_TRANS_PERMINUTE=`egrep "Server.Trans.PerMinute =" runStatOutput.txt | awk -F"=" '{gsub(/ /,"",$2); print $2}'`
SERVER_AVAILABILITYINDEX=`egrep "Server.AvailabilityIndex =" runStatOutput.txt | awk -F"=" '{gsub(/ /,"",$2); print $2}'`
REPLICA_CLUSTER_SECONDSONQUEUE=`egrep "Replica.Cluster.SecondsOnQueue =" runStatOutput.txt | awk -F"=" '{gsub(/ /,"",$2); print $2}'`
REPLICA_CLUSTER_WORKQUEUEDEPTH=`egrep "Replica.Cluster.WorkQueueDepth =" runStatOutput.txt | awk -F"=" '{gsub(/ /,"",$2); print $2}'`
MAIL_WAITING=`egrep "Mail.Waiting =" runStatOutput.txt | awk -F"=" '{gsub(/ /,"",$2); print $2}'`
echo $SERVER_TRANS_PERMINUTE
echo $SERVER_AVAILABILITYINDEX
exit 0

Save and Close


Testing

In Domino console run this command

> < runstat.cmd

Return

> Show Stat >runStatOutput.txt
> Load runstat2.sh
> 0
100

>

Putting in Production

Create a Program Document, like :

Basics

-

Schedule

-

Program name:

server

Enabled/disabled:

Enabled

Command line:

-c "< runStat.cmd"

Run at times:

00:00 - 23:59 each day

Server to run on:

notes2/Company

Repeat interval of:

5 minutes

Comments:

Days of week:

Sun, Mon, Tue, Wed, Thu, Fri, Sat

Ver também