1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MQパラメータシート作成

1
Last updated at Posted at 2025-07-26

QMGR情報出力

su -u mqm | echo "dis qmgr" | /opt/mqm/bin/runmqsc JMS > /tmp/jms.txt

必要な情報だけ取り出す

awk -F[\(\)] '{printf $1","$3"\n"}' /tmp/jms.txt | awk '/QMNAME/,/VERSION/' | sed 's/ //g' > qmgr_object.txt

オブジェクトだけを抜き出しました

awk -F[\(\)] '{printf $1","$3"\n"}' /tmp/jms.txt | awk '/QMNAME/,/VERSION/' | sed 's/ //g' > QMGR_OBJECT.txt

作成中

#!/usr/bin/bash

function func_html {

     NAME=$1
     VALUE=$2

     cat << EOF


     <tr>
     <td>${NAME}</td><td>${VALUE}</td>
     <tr>




EOF
}



QMGR_INFO=/tmp/jms.txt

#
#OBJECT=$(awk -F[\(\)] '{printf $1","$3"\n"}' ${QMGR_INFO} | awk '/QMNAME/,/VERSION/' | sed 's/ //g' | sed -z 's/\n/,/g')

#1回ファイルに出力タイプで
#awk -F[\(\)] '{printf $1","$3"\n"}' ${QMGR_INFO} | awk '/QMNAME/,/VERSION/' | sed 's/ //g' | sed -z 's/\n/,/g' > qmgrobject.txt

awk -F[\(\)] '{printf $1","$3"\n"}' /tmp/jms.txt | awk '/QMNAME/,/VERSION/' | sed 's/ //g' | sed 's/,/\n/g' | sed '/^$/d' > OJBECT.txt



#echo $OBJECT

while read obj

do
    while read line
    do

        if [[ "$line" =~ $obj ]] ; then

            obj_position=$(expr index "$line" "\(")
            value_end_position=$(expr index "$line" "\)")

            ##MQキューマネジャーのVALUEが存在しない対応(SYNCPT)

            if [[ $obj == SYNCPT ]] ; then

                continue

            fi

            obj_name_end=$(expr ${obj_position} - 1 )
            obj_value_start=$(expr ${obj_position} + 1 )
            obj_value_end=$(expr ${value_end_position} - 1 )

            OBJ_NAME=$(echo $line | cut -c 1-${obj_name_end})
            OBJ_VALUE=$(echo $line | cut -c ${obj_value_start}-${obj_value_end})


            echo ${OBJ_NAME} ${OBJ_VALUE}

            obj_position=""
            value_end_position=""


            func_html ${OBJ_NAME} ${OBJ_VALUE}  >> mq.html




        fi
    done</tmp/jms3.txt


done<OJBECT.txt


[root@mq1 tmp]#
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?