JP2005078122A - Lock status detection device and lock status detection method and its program - Google Patents

Lock status detection device and lock status detection method and its program Download PDF

Info

Publication number
JP2005078122A
JP2005078122A JP2003209783A JP2003209783A JP2005078122A JP 2005078122 A JP2005078122 A JP 2005078122A JP 2003209783 A JP2003209783 A JP 2003209783A JP 2003209783 A JP2003209783 A JP 2003209783A JP 2005078122 A JP2005078122 A JP 2005078122A
Authority
JP
Japan
Prior art keywords
lock state
command
state detection
response
normality
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003209783A
Other languages
Japanese (ja)
Inventor
Nobuhiro Kimura
伸宏 木村
Sho Yamada
祥 山田
Hirotaka Yoshizu
浩隆 芳須
Akemi Oka
朱実 岡
Hiroyuki Iinuma
寛幸 飯沼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Nippon Telegraph and Telephone Corp
Original Assignee
NEC Corp
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp, Nippon Telegraph and Telephone Corp filed Critical NEC Corp
Priority to JP2003209783A priority Critical patent/JP2005078122A/en
Publication of JP2005078122A publication Critical patent/JP2005078122A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a lock status detection device equipped with a function to automatically detect the lock status of a process. <P>SOLUTION: This lock status detection method comprises a monitor target process to make a response based on the performance instruction of normality response processing, a normality confirmation command to instruct the monitor target process to perform the normality response processing, and to accept the response and a lock status detection process to perform the normality confirmation command, and to detect the lock status of the monitor target process based on the response notified from the normality confirmation command. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
この発明は、コンピュータシステムに係り、特に、ロック状態検出装置およびロック状態検出方法ならびにそのプログラムに関するものである。
【0002】
【従来の技術】
従来、UNIX(登録商標)システム上で起動しているプロセスが正常に動作しているか否かを判断するためには、UNIX(登録商標)のOS(Operating System)が備えているps(Report Process Status)コマンドを実行してプロセスが正常に動作しているかいなかを判断している(例えば、特許文献1参照)。また、他の方法では、例えばユーザがGUI(Graphical User Interface)を利用してプロセスを操作するコマンドを実行し、当該コマンドの実行に応答するか否かによってプロセスが正常に動作しているかいないかを判断している。
【0003】
【特許文献1】
特開平2002−342107号公報
【0004】
【発明が解決しようとする課題】
しかしながら、上述のpsコマンドによってプロセスが正常か否かを判断する方法では、プロセスがUNIX(登録商標)システム上で起動されているか否かを調べるだけなので、起動しているプロセスが異常停止(以下、プロセスのロック状態と呼ぶ)してしまっている場合でも、psコマンドの結果にロック状態のプロセスが表示されてしまい、これにより、プロセスが正常に起動されていると判断できてしまう。したがってpsコマンドを用いる方法ではプロセスがロック状態であることを検出できないという問題がある。また、ユーザがロック状態のプロセスに対してコマンドを発行することでプロセスが正常か否かを判断する方法では、自動的にプロセスのロック状態を判断できないという問題がある。
そこでこの発明は、プロセスのロック状態の検出を自動で行なうことのできる機能を備えた、ロック状態検出装置およびロック状態検出方法ならびにそのプログラムを提供することを目的としている。
【0005】
【課題を解決するための手段】
本発明は、上述の課題を解決すべくなされたもので、正常性応答処理の実行指示に基づいて応答を行なう監視対象プロセスと、前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける正常性確認コマンドと、前記正常性確認コマンドを実行し、当該正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出するロック状態検出プロセスと、を備えることを特徴とするロック状態検出装置である。
【0006】
上述の構成によれば、本発明は、監視対象プロセスが正常性応答処理の実行指示に基づいて応答を行ない、正常性確認コマンドが監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける。そしてロック状態検出プロセスが、正常性確認コマンドを実行し、当該正常性確認コマンドから通知される前記応答に基づいて、監視プロセスのロック状態を検出する。これにより、監視対象プロセスがUNIX(登録商標)システム上で起動されているか否かを調べるだけの方法であるpsコマンドの実行と比べて、正確に監視対象プロセスのロック状態を検出できる。
【0007】
また本発明は、上述のロック状態検出装置が、実行された前記正常性確認コマンドを強制終了するタイムアウトコマンドと、前記監視対象プロセスを強制終了する終了コマンドとを備え、前記ロック状態検出プロセスは前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行することを特徴とする。
【0008】
上述の構成によれば、本発明は、ロック状態検出プロセスが、正常性確認コマンドの実行から一定時間経過しても応答の通知がない場合にタイムアウトコマンドを実行し、監視対象プロセスからの応答が異常である場合または正常性確認コマンドの実行から一定時間経過しても応答の通知がない場合のいずれかの場合に終了コマンドを実行する。これにより、ユーザがわざわざ手動でpsコマンドを実行したり、GUIから監視対象プロセスを操作するコマンドなどを実行したりすることなく、自動で監視対象プロセスのロック状態を検出し、強制終了することが出来る。また、自動で監視対象プロセスのロック状態が検出できるので、ユーザはロック状態の監視対象プロセスを早期に発見し、プロセス再起動などのアクションをとることができるようになる。
【0009】
また本発明は、監視対象プロセスのロック状態検出装置であって、前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出するロック状態検出プロセスを備えることを特徴とするロック状態検出装置である。これにより、ユーザがわざわざ手動でpsコマンドを実行したり、GUIから監視対象プロセスを操作するコマンドなどを実行したりすることなく、自動で監視対象プロセスのロック状態を検出することができる。また、自動で監視対象プロセスのロック状態が検出できるので、ユーザはロック状態の監視対象プロセスを早期に発見し、プロセス再起動などのアクションをとることができるようになる。
【0010】
また本発明は、上述のロック状態検出装置が、前記監視対象プロセスを強制終了する終了コマンドを備え、前記ロック状態検出プロセスは、前記CPU使用時間が前記閾値を超えている場合に前記終了コマンドを実行することを特徴する。これにより、監視対象プロセスがロック状態の場合には当該監視対象プロセスを自動で強制終了することが出来る。
【0011】
また本発明は、上述のロック状態検出装置において、前記正常性確認コマンドが特定の前記監視対象プロセス用に用意されたコマンドであることを特徴とする。これにより、複数の監視対象プロセスに対して正常性応答処理の実行指示の処理を行なう正常性確認コマンドではなく、1つの特定の監視対象プロセスに対して正常性応答処理の実行指示の処理を行う正常性確認コマンドを作成すればよいので、ユーザは複数の監視対象プロセスに対して正常性応答処理の実行指示の処理を行なう正常性確認コマンドを作成するのに比べて、容易に当該正常性確認コマンドを作成することができる。
【0012】
また本発明は、正常性応答処理の実行指示に基づいて応答を行なう監視対象プロセスのロック状態検出方法であって、ロック状態検出プロセスが、正常性確認コマンドを実行する過程と、正常性確認コマンドが、前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける過程と、前記ロック状態検出プロセスが、前記正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出する過程とを有することを特徴とするロック状態検出方法である。
【0013】
また本発明は、上述のロック状態検出方法であって、前記ロック状態検出プロセスが、前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行する過程と、前記タイムアウトコマンドが、実行された前記正常性確認コマンドを強制終了する過程と、前記終了コマンドが、前記監視対象プロセスを強制終了する過程とを有することを特徴とする。
【0014】
また本発明は、監視対象プロセスのロック状態検出方法であって、ロック状態検出プロセスが、前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出する過程を有することを特徴とするロック状態検出方法である。
【0015】
また本発明は、上述のロック状態検出方法であって、前記ロック状態検出プロセスが、前記CPU使用時間が前記閾値を超えている場合に終了コマンドを実行する過程と、前記終了コマンドが、前記監視対象プロセスを強制終了する過程とを有することを特徴する。
【0016】
また本発明は、上述のロック状態検出方法であって、前記正常性確認コマンドは特定の前記監視対象プロセス用に用意されたコマンドであることを特徴とする。
【0017】
また本発明は、監視対象プロセスのロック状態を検出するロック状態検出装置のコンピュータに実行させるプログラムであって、ロック状態検出プロセスが、正常性確認コマンドを実行する過程と、正常性確認コマンドが、前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を前記監視対象プロセスより受け付ける過程と、前記ロック状態検出プロセスが、前記正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出する過程との処理をコンピュータに実行させるプログラムである。
【0018】
また本発明は、前記ロック状態検出プロセスが、前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行する過程と、前記タイムアウトコマンドの実行に基づいて、実行された前記正常性確認コマンドを強制終了する過程と、前記終了コマンドの実行に基づいて、前記監視対象プロセスを強制終了する過程との処理をコンピュータに実行させるプログラムである。
【0019】
また本発明は、監視対象プロセスのロック状態を検出するロック状態検出装置のコンピュータに実行させるプログラムであって、前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出する過程の処理をコンピュータに実行させるプログラムである。
【0020】
また本発明は、前記ロック状態検出プロセスが、前記CPU使用時間が前記閾値を超えている場合に終了コマンドを実行する過程と、前記終了コマンドの実行に基づいて、前記監視対象プロセスを強制終了する過程との処理をコンピュータに実行させるプログラムである。
【0021】
また本発明は、特定の前記監視対象プロセス用に用意された前記正常性確認コマンドを実行させるプログラムである。
【0022】
【発明の実施の形態】
以下、本発明の一実施形態によるロック状態検出装置を図面を参照して説明する。
図1は、この発明の一実施形態によるロック状態検出装置の構成を示す概略ブロック図である。この図において符号1はOSとしてUNIX(登録商標)システムを採用したロック状態検出装置である。また、符号11は監視対象プロセスがロック状態か否かを検出するロック状態検出プロセスである。また符号12は監視対象プロセスである。また符号13は監視対象プロセス12のプロセス名などが記述されているプロセス名ファイルである。
【0023】
また14は監視対象プロセス12の正常性を確認するためのロック状態検出プロセス11の動作が記述されている正常性確認シェル(正常性確認コマンド)であり、この正常性確認シェル14の記述の中にはプロセスのロック状態の判断が可能となるコマンドが含まれる。また15は監視対象プロセス12からの正常性確認応答に対応する応答が一定時間ない場合に正常性確認シェル14の処理を停止するためのロック状態検出プロセス11の動作が記述されているタイムアウトシェル(タイムアウトコマンド)であり、このタイムアウトシェル15の記述の中にはロック状態となったプロセスを強制終了させるコマンドが含まれる。また16はロック状態の監視対象プロセス12を強制終了するためのロック状態検出プロセス11の動作が記述されている終了シェル(終了コマンド)であり、この終了シェル16の記述の中にはロック状態となった監視対象プロセス12を強制終了させるコマンドが含まれる。また17は監視対象プロセス12のプロセスIDやCPU使用時間などを格納するプロセス情報格納ファイルである。またこのプロセス情報格納ファイルは監視対象プロセス12ごとに作成されてロック状態検出装置1が記憶している。そして、上述の正常性確認シェル14とタイムアウトシェル15と終了シェル16は、1つの監視対象プロセス12に対して各1つずつ作成される。また上述のシェルとはシェルスクリプトのことである。また上述のロック状態とは、psコマンドを実行する事により得られる情報(プロセスIDなどの情報)では判断できないプロセスの異常状態であり、また、監視対象プロセス12の動作がユーザの期待する動作を行なわない状態のことを言う。
【0024】
なお、ロック状態検出プロセス11は、正常性確認シェル14を実行してその応答により監視対象プロセス12がロック状態であるか否かを検出し、ロック状態である場合にはタイムアウトシェル15や終了シェル16を実行して監視対象プロセス12の強制終了を行なう。また、監視対象プロセス12は正常性確認シェル14からの正常性応答処理の実行指示に基づいて、正常か異常かの応答を通知する応答手段を備えている。またロック状態検出プロセス11は、監視対象プロセス12のプロセス情報格納ファイル17に記述されているCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、監視対象プロセス12のロック状態を検出する。
【0025】
図2はプロセス名ファイルに記述されているデータ内容を示す図である。この図が示すように、プロセス名ファイル13には、通番、実行周期、確認種別、プロセス情報確認種別、リトライ回数、タイムアウト時間(一定時間)、正常性確認シェル名、タイムアウトシェル名、終了シェル名、監視対象プロセス削除種別、監視対象プロセス名、CPU時間最大値などが記述されている。
ここで、実行周期とはロック状態検出プロセス11が正常性確認シェル14を実行する周期である。また確認種別とは監視対象が、プロセスかまたはコマンドかを示す情報である。またプロセス情報確認種別は監視対象プロセス12のロック状態を判定する手法を示す情報であり、プロセス情報確認種別が「CPU時間監視」の場合にはロック状態検出プロセス11は監視対象プロセス12のCPUの使用時間に基づいてロック状態を検出し、プロセス情報確認種別が「正常性確認シェルの実行」の場合にはロック状態検出プロセス11は正常性確認シェル14の実行を実行することにより監視対象プロセス12から通知される応答に基づいて基づいてロック状態を検出し、プロセス情報確認種別が「ALL」の場合には、ロック状態検出プロセス11は「CPU時間監視」と「正常性確認シェルの実行」の両方の手法に基づいて監視対象プロセス12のロック状態の検出を行なう。
【0026】
次に、監視対象プロセスが正常である場合のロック状態検出装置の処理について説明する。図3は監視対象プロセスが正常である場合のロック状態検出装置の処理を示す図である。
まず、ロック状態検出プロセス11は、プロセス名ファイル13に記述された監視対象プロセス12のプロセス名、正常性確認シェル名とタイムアウトシェル名と終了シェル名、正常性確認シェルを実行する周期、正常性確認シェル実行に対応する応答のタイムアウト時間などを読み出す。次にロック状態検出プロセス11は、プロセス名ファイル13から読み出した監視対象プロセス12のプロセス名に基づいて、例えばpsコマンドなどを用いてプロセスIDを取得する。
【0027】
次に、ロック状態検出プロセス11はプロセス名ファイル13から取得したプロセスの確認種別に基づいて、CPU時間に基づいた監視対象プロセス12のロック状態の検出か、正常性確認シェル14の実行による監視対象プロセス12のロック状態の検出かを判定する。ここでプロセスの確認種別が「正常性確認シェルの実行」を示す場合には、ロック状態検出プロセス11は、取得したプロセスIDとプロセス名ファイル13から読み出した正常性確認シェル名とを用いて、正常性確認シェル14を実行し(ステップS301)、監視対象のプロセス12が正常か否かを確認する。ここで、ロック状態検出プロセス11は正常性確認シェルの実行に対応する応答が通知されるまでの時間を計測するタイムアウト計測プロセスを起動するために、タイムアウト計測プロセスが保持する応答フラグをONにし、またタイムアウト計測プロセスにタイムアウト時間を通知する。すると、タイムアウト計測プロセスが起動し、これによりロック状態検出プロセス11は、プロセス名ファイル13から読み出したタイムアウト時間を計測するようタイムアウト計測プロセスに指示する。
【0028】
次に、正常性確認シェル14が、監視対象プロセス12に対して正常性応答処理の実行を指示する(ステップS302)。すると監視対象プロセス12は、正常であれば正常応答を正常性確認シェル14へ行なう(ステップS303)。そして正常性確認シェル14は、受け付けた正常応答をロック状態検出プロセス11へ通知する(ステップS304)。次に、ロック状態検出プロセス11は正常応答の通知を受けると、タイムアウト計測プロセスからタイムアウトの通知がなければ(正常応答の通知がタイムアウト時間内の通知であれば)、正常応答を判断し(ステップS305)、プロセス名ファイル13から読み取った正常性確認シェルの実行の周期ごとに正常性確認シェルの実行を行なう(ステップS306)。そして、正常性確認シェル14は監視対象プロセス12に対して再度の正常性応答処理の実行を行なう(ステップS307)。なお、監視対象プロセス12が正常性応答処理の実行に対応する応答手段を備えていない場合には、終了シェル16はKillコマンドを発行して監視対象プロセス12をを終了させるようにしてもよい。
【0029】
次に監視対象プロセスがロック状態の場合のロック状態検出装置の処理について説明する。図4は監視対象プロセスがロック状態の場合のロック状態検出装置の処理を示す図である。
まず、ロック状態検出プロセス11は、プロセス名ファイル13に記述された監視対象プロセス12のプロセス名、正常性確認シェル名とタイムアウトシェル名と終了シェル名、正常性確認シェルを実行する周期、正常性確認シェル実行に対応する応答のタイムアウト時間などを読み出す。次にロック状態検出プロセス11は、プロセス名ファイル13から読み出した監視対象プロセス12のプロセス名に基づいて、例えばpsコマンドなどを用いてプロセスIDを取得する。
【0030】
次に、ロック状態検出プロセス11はプロセス名ファイル13から取得したプロセスの確認種別に基づいて、CPU時間に基づいた監視対象プロセス12のロック状態の検出か、正常性確認シェル14の実行による監視対象プロセス12のロック状態の検出かを判定する。ここでプロセスの確認種別が「正常性確認シェルの実行」を示す場合には、ロック状態検出プロセス11は、取得したプロセスIDとプロセス名ファイル13から読み出した正常性確認シェル名とを用いて、正常性確認シェル14を実行し(ステップS401)、監視対象のプロセス12が正常か否かを確認する。ここで、ロック状態検出プロセス11は正常性確認シェルの実行に対応する応答が通知されるまでの時間を計測するタイムアウト計測プロセスを起動するために、タイムアウト計測プロセスが保持する応答フラグをONにし、またタイムアウト計測プロセスにタイムアウト時間を通知する。すると、タイムアウト計測プロセスが起動し、これによりロック状態検出プロセス11は、プロセス名ファイル13から読み出したタイムアウト時間を計測するようタイムアウト計測プロセスに指示する。
【0031】
次に、正常性確認シェルが、監視対象プロセス12に対して正常性応答処理の実行を指示する(ステップS402)。すると監視対象プロセス12は、、ロック状態である場合、異常応答を正常性確認シェル14へ行なう(ステップS403)。そして、正常性確認シェル14は受け付けた異常応答をロック状態検出プロセス11へ通知する(ステップS404)。次に、ロック状態検出プロセス11は異常応答の通知を受けると、タイムアウト計測プロセスからタイムアウトの通知がなければ(正常応答の通知がタイムアウト時間内の通知であれば)、異常応答を判断し(ステップS405)、終了シェル16を実行する(ステップS406)。そして、終了シェル16が監視対象プロセス12を強制終了させる(ステップS407)。なお、監視対象プロセス12が正常性応答処理の実行に対応する応答手段を備えていない場合には、終了シェル16はKillコマンドを発行して監視対象プロセス12をを終了させるようにしてもよい。
【0032】
次に正常性確認シェルの実行に対応する監視対象プロセスからの応答がない場合のロック状態検出装置の処理について説明する。図5は監視対象プロセスからの応答がない場合のロック状態検出装置の処理を示す図である。
まず、ロック状態検出プロセス11は、プロセス名ファイル13に記述された監視対象プロセス12のプロセス名、正常性確認シェル名とタイムアウトシェル名と終了シェル名、正常性確認シェルを実行する周期、正常性確認シェル実行に対応する応答のタイムアウト時間などを読み出す。次にロック状態検出プロセス11は、プロセス名ファイル13から読み出した監視対象プロセス12のプロセス名に基づいて、例えばpsコマンドなどを用いてプロセスIDを取得する。
【0033】
次に、ロック状態検出プロセス11はプロセス名ファイル13から取得したプロセスの確認種別に基づいて、CPU時間に基づいた監視対象プロセス12のロック状態の検出か、正常性確認シェル14の実行による監視対象プロセス12のロック状態の検出かを判定する。ここでプロセスの確認種別が「正常性確認シェルの実行」を示す場合には、ロック状態検出プロセス11は、取得したプロセスIDとプロセス名ファイル13から読み出した正常性確認シェル名とを用いて、正常性確認シェル14を実行し(ステップS501)、監視対象のプロセス12が正常か否かを確認する。ここで、ロック状態検出プロセス11は正常性確認シェルの実行に対応する応答が通知されるまでの時間を計測するタイムアウト計測プロセスを起動するために、タイムアウト計測プロセスが保持する応答フラグをONにし、またタイムアウト計測プロセスにタイムアウト時間を通知する。すると、タイムアウト計測プロセスが起動し、これによりロック状態検出プロセス11は、プロセス名ファイル13から読み出したタイムアウト時間を計測するようタイムアウト計測プロセスに指示する。
【0034】
次に、正常性確認シェルが、監視対象プロセス12に対して正常性応答処理の実行を指示する(ステップS502)。ここで、監視対象プロセス12からの応答が来ない状態が続くと、タイムアウト計測プロセスはタイムアウト時間の経過を判断し、応答フラグをOFFに書き換える。そして、タイムアウト計測プロセスは応答フラグがOFFであることを確認すると、ロック状態検出プロセス11に対してタイムアウト時間が経過したことを通知するシグナルを発行する(ステップS503)。次に、ロック状態検出プロセス11はタイムアウト時間が経過したことを通知するシグナルを受け取ると、プロセス名ファイル13から読み出したタイムアウトシェル15を実行する(ステップS504)。するとタイムアウトシェル15は正常性確認シェルを強制終了する(ステップS505)。そしてタイムアウトシェル15は正常性確認シェルを強制終了するとロック状態検出プロセス11へ強制終了が完了した旨の通知を行なう(ステップS506)。そしてロック状態検出プロセス11はプロセス名ファイル13から読み出した終了シェル16を実行し(ステップS507)、終了シェル16が監視対象プロセス12を強制終了させる(ステップS508)。なお、監視対象プロセス12が正常性応答処理の実行に対応する応答手段を備えていない場合には、終了シェル16はKillコマンドを発行して監視対象プロセス12を終了させるようにしてもよい。
【0035】
次に監視対象プロセスのCPU使用時間に基づいて、監視対象プロセスがロック状態か否かを判定する際のロック状態検出装置の処理について説明する。図6は監視対象プロセスのCPU使用時間に基づいてロック状態を判定する際のロック状態検出装置の処理を示す図である。
まず、ロック状態検出プロセス11は、プロセス名ファイル13に記述された監視対象プロセス12のプロセス名、正常性確認シェル名とタイムアウトシェル名と終了シェル名、正常性確認シェルを実行する周期、正常性確認シェル実行に対応する応答のタイムアウト時間、プロセスの確認種別、CPU使用時間最大値(閾値)を読み出す。次にロック状態検出プロセス11は、プロセス名ファイル13から読み出した監視対象プロセス12のプロセス名に基づいて、psコマンドを用いて監視対象プロセス12のプロセスIDを取得する(ステップS601)。
【0036】
次に、ロック状態検出プロセス11はプロセス名ファイル13から取得したプロセスの確認種別に基づいて、CPU時間に基づいた監視対象プロセス12のロック状態の検出か、正常性確認シェル14の実行による監視対象プロセス12のロック状態の検出かを判定する(ステップS602)。ここでプロセスの確認種別が「CPU時間監視」を示す場合には、ロック状態検出プロセス11は、CPU時間に基づいた監視対象プロセス12のロック状態の検出を行なうにあたり、ステップS601において取得したプロセスIDが記述されているプロセス情報格納ファイル17を確認する。そして当該プロセス情報格納ファイル17に記述されている監視対象プロセス12のCPU使用時間の合計を一定時間おきに確認する。そしてロック状態検出プロセス11は、2回のCPU使用時間の合計の確認でそれぞれCPU使用時間の合計を取得し、当該CPU使用時間の合計の差(CPU使用時間の合計を確認してから次にCPU使用時間の合計を確認するまでの間に増加したCPU使用時間の合計)を算出する。
【0037】
そして算出したCPU使用時間の差とプロセス名ファイル13から読み取ったCPU使用時間最大値とを比較する。そしてロック状態検出プロセス11は、算出したCPU使用時間の差がCPU使用時間最大値を超えている場合には、プロセス名ファイル13から読み出した終了シェル16を実行し(ステップS603)、終了シェル16が監視対象プロセス12を強制終了させる。
【0038】
なお、上述のロック状態検出装置は内部に、コンピュータシステムを有している。そして、上述した処理の過程は、プログラムの形式でコンピュータ読み取り可能な記録媒体に記憶されており、このプログラムをコンピュータが読み出して実行することによって、上記処理が行われる。ここでコンピュータ読み取り可能な記録媒体とは、磁気ディスク、光磁気ディスク、CD−ROM、DVD−ROM、半導体メモリ等をいう。また、このコンピュータプログラムを通信回線によってコンピュータに配信し、この配信を受けたコンピュータが当該プログラムを実行するようにしても良い。
また、上述のプロセスとはプログラムのOSの管理下での実行単位のことである。そして、ロック状態検出装置のコンピュータの処理において、主記憶がハードディスクなどの記録媒体に記録されたプログラムを読み取って記憶し、CPUが主記憶の記憶するプログラムを実行する。またCPUは当該実行したプログラム用のデータを主記憶から読み込み、また前記実行したプログラム用のデータを主記憶に書き込む処理を行なう。そして、コンピュータのプログラム毎の処理の実行単位であるプロセスがOSの管理下で並列に複数処理される。
【0039】
【発明の効果】
本発明によれば、監視対象プロセスが正常性応答処理の実行指示に基づいて応答を行ない、正常性確認コマンドが監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける。そしてロック状態検出プロセスが、正常性確認コマンドを実行し、当該正常性確認コマンドから通知される前記応答に基づいて、監視プロセスのロック状態を検出する。これにより、監視対象プロセスがUNIX(登録商標)システム上で起動されているか否かを調べるだけの方法であるpsコマンドの実行と比べて、正確に監視対象プロセスのロック状態を検出できる。
【0040】
また本発明によれば、ロック状態検出プロセスが、正常性確認コマンドの実行から一定時間経過しても応答の通知がない場合にタイムアウトコマンドを実行し、監視対象プロセスからの応答が異常である場合または正常性確認コマンドの実行から一定時間経過しても応答の通知がない場合のいずれかの場合に終了コマンドを実行する。これにより、ユーザがわざわざ手動でpsコマンドを実行したり、GUIから監視対象プロセスを操作するコマンドなどを実行したりすることなく、自動で監視対象プロセスのロック状態を検出し、強制終了することが出来る。また、自動で監視対象プロセスのロック状態が検出できるので、ユーザはロック状態の監視対象プロセスを早期に発見し、プロセス再起動などのアクションをとることができるようになる。
【0041】
また本発明によれば、監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、監視対象プロセスのロック状態を検出するロック状態検出プロセスを備えることを特徴とするロック状態検出装置である。これにより、ユーザがわざわざ手動でpsコマンドを実行したり、GUIから監視対象プロセスを操作するコマンドなどを実行したりすることなく、自動で監視対象プロセスのロック状態を検出することができる。また、自動で監視対象プロセスのロック状態が検出できるので、ユーザはロック状態の監視対象プロセスを早期に発見し、プロセス再起動などのアクションをとることができるようになる。
【0042】
また本発明は、上述のロック状態検出装置が、監視対象プロセスを強制終了する終了コマンドを備え、ロック状態検出プロセスは、CPU使用時間が閾値を超えている場合に終了コマンドを実行することを特徴する。これにより、監視対象プロセスがロック状態の場合には当該監視対象プロセスを自動で強制終了することが出来る。
【0043】
また本発明は、上述のロック状態検出装置において、前記正常性確認コマンドが特定の前記監視対象プロセス用に用意されたコマンドであることを特徴とする。これにより、複数の監視対象プロセスに対して正常性応答処理の実行指示の処理を行なう正常性確認コマンドではなく、1つの特定の監視対象プロセスに対して正常性応答処理の実行指示の処理を行う正常性確認コマンドを作成すればよいので、ユーザは複数の監視対象プロセスに対して正常性応答処理の実行指示の処理を行なう正常性確認コマンドを作成するのに比べて、容易に当該正常性確認コマンドを作成することができる。
【図面の簡単な説明】
【図1】この発明の一実施形態によるロック状態検出装置の構成を示す概略ブロック図である。
【図2】本発明の実施形態による、プロセス名ファイルに記述されているデータ内容を示す図である。
【図3】本発明の実施形態による、監視対象プロセスが正常である場合のロック状態検出装置の処理を示す図である。
【図4】本発明の実施形態による、監視対象プロセスがロック状態の場合のロック状態検出装置の処理を示す図である。
【図5】本発明の実施形態による、監視対象プロセスからの応答がない場合のロック状態検出装置の処理を示す図である。
【図6】本発明の実施形態による、監視対象プロセスのCPU使用時間に基づいてロック状態を判定する際のロック状態検出装置の処理を示す図である。
【符号の説明】
1 ロック状態検出装置
11 ロック状態検出プロセス
12 監視対象プロセス
13 プロセス名ファイル
14 正常性確認シェル
15 タイムアウトシェル
16 終了シェル
17 プロセス情報格納ファイル
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a computer system, and more particularly to a lock state detection device, a lock state detection method, and a program therefor.
[0002]
[Prior art]
Conventionally, in order to determine whether or not a process running on a UNIX (registered trademark) system is operating normally, ps (Report Process) provided in an OS (Operating System) of UNIX (registered trademark). A (Status) command is executed to determine whether the process is operating normally (see, for example, Patent Document 1). In another method, for example, whether a user operates a command that uses a GUI (Graphical User Interface) to operate the process and responds to the execution of the command. Judging.
[0003]
[Patent Document 1]
JP-A-2002-342107
[0004]
[Problems to be solved by the invention]
However, in the method for determining whether or not a process is normal by the above-described ps command, it is only checked whether or not the process is started on the UNIX (registered trademark) system. Even if the process is locked), the locked process is displayed in the result of the ps command, and it can be determined that the process is normally started. Therefore, there is a problem that the method using the ps command cannot detect that the process is locked. In addition, the method of determining whether or not a process is normal by issuing a command to a process in a locked state has a problem that the locked state of the process cannot be automatically determined.
Accordingly, an object of the present invention is to provide a lock state detection device, a lock state detection method, and a program therefor, which have a function capable of automatically detecting the lock state of a process.
[0005]
[Means for Solving the Problems]
The present invention has been made in order to solve the above-described problems. A monitoring target process that responds based on an instruction to execute normality response processing, and an instruction to execute normality response processing are issued to the monitoring target process. A normality confirmation command that accepts a response; and a lock state detection process that executes the normality confirmation command and detects a lock state of the monitoring process based on the response notified from the normality confirmation command. This is a lock state detecting device.
[0006]
According to the above configuration, in the present invention, the monitoring target process responds based on the execution instruction of the normality response process, and the normality confirmation command instructs the monitoring target process to execute the normality response process. Accept. Then, the lock state detection process executes a normality confirmation command, and detects the lock state of the monitoring process based on the response notified from the normality confirmation command. As a result, the locked state of the monitored process can be detected more accurately as compared to the execution of the ps command, which is a method for merely checking whether the monitored process is activated on the UNIX (registered trademark) system.
[0007]
According to the present invention, the lock state detection device includes a timeout command for forcibly terminating the executed normality confirmation command and an end command for forcibly terminating the process to be monitored. The time-out command is executed when the response is not notified even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal or constant from the execution of the normality confirmation command. The end command is executed when the response is not notified even after a lapse of time.
[0008]
According to the above configuration, according to the present invention, the lock state detection process executes the time-out command when no response is notified even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is The termination command is executed when there is an abnormality or when there is no response notification after a certain period of time has elapsed since the execution of the normality confirmation command. As a result, the locked state of the monitored process can be automatically detected and forcibly terminated without the user having to manually execute the ps command or execute a command for operating the monitored process from the GUI. I can do it. In addition, since the lock state of the monitoring target process can be automatically detected, the user can find the monitoring target process in the locked state at an early stage and take actions such as process restart.
[0009]
Further, the present invention is a lock state detection apparatus for a monitoring target process, acquires the CPU usage time of the monitoring target process, and based on whether the CPU usage time exceeds a predetermined threshold, A lock state detection apparatus comprising a lock state detection process for detecting a lock state of a process to be monitored. As a result, the locked state of the monitored process can be automatically detected without the user having to manually execute the ps command or execute a command for operating the monitored process from the GUI. In addition, since the lock state of the monitoring target process can be automatically detected, the user can find the monitoring target process in the locked state at an early stage and take actions such as process restart.
[0010]
Further, according to the present invention, the lock state detection device described above includes an end command for forcibly terminating the monitored process, and the lock state detection process outputs the end command when the CPU usage time exceeds the threshold value. Characterized by performing. Thereby, when the monitoring target process is locked, the monitoring target process can be automatically forcibly terminated.
[0011]
According to the present invention, in the above-described lock state detection apparatus, the normality confirmation command is a command prepared for a specific process to be monitored. Thus, instead of the normality confirmation command for executing the execution instruction of the normality response process for a plurality of monitoring target processes, the execution instruction for the normality response process is executed for one specific monitoring target process. Since it is sufficient to create a normality confirmation command, the user can easily check the normality compared to creating a normality confirmation command that performs the execution instruction of normality response processing for multiple monitored processes. You can create commands.
[0012]
The present invention also relates to a lock state detection method for a monitoring target process that makes a response based on an execution instruction for normality response processing, wherein the lock state detection process executes a normality confirmation command, and the normality confirmation command Instructing the monitoring target process to execute normality response processing and accepting the response, and the lock state detection process is based on the response notified from the normality confirmation command. And a lock state detecting method comprising: detecting a lock state.
[0013]
Further, the present invention is the above-described lock state detection method, wherein the lock state detection process executes the timeout command when there is no notification of the response even after a lapse of a predetermined time from the execution of the normality confirmation command. A process of executing the end command when the response from the monitoring target process is abnormal or when there is no notification of the response even after a certain period of time has elapsed since the execution of the normality confirmation command; The timeout command includes a process of forcibly terminating the executed normality confirmation command, and a process of the termination command forcibly terminating the monitored process.
[0014]
The present invention is also a method for detecting a lock state of a monitoring target process, wherein the lock state detection process acquires the CPU usage time of the monitoring target process and whether the CPU usage time exceeds a predetermined threshold value. The lock state detection method includes a step of detecting the lock state of the monitored process based on the above.
[0015]
The present invention is the above-described lock state detection method, wherein the lock state detection process executes a termination command when the CPU usage time exceeds the threshold, and the termination command includes the monitoring command. And a process of forcibly terminating the target process.
[0016]
Further, the present invention is the above-described lock state detection method, wherein the normality confirmation command is a command prepared for a specific process to be monitored.
[0017]
Further, the present invention is a program that is executed by a computer of a lock state detection device that detects a lock state of a monitored process, wherein the lock state detection process executes a normality confirmation command, and the normality confirmation command includes: Instructing the monitoring target process to execute normality response processing, receiving the response from the monitoring target process, and the lock state detection process based on the response notified from the normality confirmation command, This is a program for causing a computer to execute a process of detecting a lock state of a monitoring process.
[0018]
In the present invention, the lock state detection process executes the timeout command when there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal. Or the execution of the end command and the execution of the time-out command in the case where there is no notification of the response even after a certain period of time has elapsed since the execution of the normality confirmation command. A program for causing a computer to execute a process of forcibly terminating the normality confirmation command and a process of forcibly terminating the monitored process based on execution of the termination command.
[0019]
According to another aspect of the present invention, there is provided a program to be executed by a computer of a lock state detection device that detects a lock state of a monitoring target process, the CPU usage time of the monitoring target process is acquired, and the CPU usage time is a predetermined threshold value. This is a program for causing a computer to execute the process of detecting the lock state of the monitoring target process based on whether or not the threshold is exceeded.
[0020]
The lock state detection process forcibly terminates the monitored process based on a process of executing a termination command when the CPU usage time exceeds the threshold and execution of the termination command. A program that causes a computer to execute processes and processes.
[0021]
The present invention is also a program for executing the normality confirmation command prepared for a specific process to be monitored.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a lock state detection apparatus according to an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a schematic block diagram showing a configuration of a lock state detection device according to an embodiment of the present invention. In this figure, reference numeral 1 denotes a lock state detection apparatus adopting a UNIX (registered trademark) system as an OS. Reference numeral 11 denotes a lock state detection process for detecting whether or not the monitored process is in a lock state. Reference numeral 12 denotes a monitored process. Reference numeral 13 denotes a process name file in which the process name of the monitoring target process 12 is described.
[0023]
Reference numeral 14 denotes a normality confirmation shell (normality confirmation command) in which the operation of the lock state detection process 11 for confirming the normality of the monitored process 12 is described. Includes a command that can determine the lock state of the process. A timeout shell (15) describes the operation of the lock state detection process 11 for stopping the processing of the normality confirmation shell 14 when there is no response corresponding to the normality confirmation response from the monitored process 12 for a predetermined time. The description of the timeout shell 15 includes a command for forcibly terminating the locked process. Reference numeral 16 denotes an end shell (end command) in which the operation of the lock state detection process 11 for forcibly terminating the monitoring target process 12 in the lock state is described. A command for forcibly terminating the monitored process 12 is included. Reference numeral 17 denotes a process information storage file that stores the process ID of the monitoring target process 12, the CPU usage time, and the like. The process information storage file is created for each monitoring target process 12 and is stored in the lock state detection apparatus 1. The normality confirmation shell 14, timeout shell 15, and termination shell 16 described above are created for each monitoring target process 12. The above-mentioned shell is a shell script. The above-mentioned lock state is an abnormal state of a process that cannot be determined by information obtained by executing the ps command (information such as process ID), and the operation of the monitoring target process 12 indicates the operation expected by the user. The state of not performing.
[0024]
The lock state detection process 11 executes the normality confirmation shell 14 and detects whether or not the monitoring target process 12 is in the lock state based on the response, and if it is in the lock state, the timeout shell 15 or the end shell is detected. 16 is executed to forcibly terminate the process 12 to be monitored. Further, the monitoring target process 12 includes response means for notifying a normal or abnormal response based on a normality response processing execution instruction from the normality confirmation shell 14. Further, the lock state detection process 11 acquires the CPU usage time described in the process information storage file 17 of the monitoring target process 12, and based on whether the CPU usage time exceeds a predetermined threshold value or not. The lock state of the monitored process 12 is detected.
[0025]
FIG. 2 is a diagram showing the data contents described in the process name file. As shown in this figure, the process name file 13 includes a serial number, an execution cycle, a confirmation type, a process information confirmation type, the number of retries, a timeout time (fixed time), a normality confirmation shell name, a timeout shell name, and an end shell name. In addition, a monitoring target process deletion type, a monitoring target process name, a CPU time maximum value, and the like are described.
Here, the execution cycle is a cycle in which the lock state detection process 11 executes the normality confirmation shell 14. The confirmation type is information indicating whether the monitoring target is a process or a command. The process information confirmation type is information indicating a method for determining the lock state of the monitoring target process 12. When the process information confirmation type is "CPU time monitoring", the lock state detection process 11 is the CPU of the monitoring target process 12. When the lock state is detected based on the usage time and the process information confirmation type is “execution of normality confirmation shell”, the lock state detection process 11 executes the normality confirmation shell 14 to execute the monitoring target process 12. The lock state is detected based on the response notified from the server, and when the process information confirmation type is “ALL”, the lock state detection process 11 performs “CPU time monitoring” and “execution of normality confirmation shell”. Based on both methods, the lock state of the monitored process 12 is detected.
[0026]
Next, processing of the lock state detection device when the monitoring target process is normal will be described. FIG. 3 is a diagram illustrating processing of the lock state detection device when the monitoring target process is normal.
First, the lock state detection process 11 includes the process name of the monitoring target process 12 described in the process name file 13, the normality confirmation shell name, the timeout shell name, the termination shell name, the cycle for executing the normality confirmation shell, and the normality. Reads the response time-out time corresponding to the confirmation shell execution. Next, the lock state detection process 11 acquires a process ID using, for example, a ps command based on the process name of the monitoring target process 12 read from the process name file 13.
[0027]
Next, the lock state detection process 11 detects the lock state of the monitoring target process 12 based on the CPU time based on the process confirmation type acquired from the process name file 13 or the monitoring target by executing the normality confirmation shell 14. It is determined whether the lock state of the process 12 is detected. Here, when the process confirmation type indicates “execution of normality confirmation shell”, the lock state detection process 11 uses the acquired process ID and the normality confirmation shell name read from the process name file 13. The normality confirmation shell 14 is executed (step S301), and it is confirmed whether or not the process 12 to be monitored is normal. Here, the lock state detection process 11 turns on the response flag held by the timeout measurement process in order to start the timeout measurement process for measuring the time until the response corresponding to the execution of the normality confirmation shell is notified, Also notifies the timeout measurement process of the timeout time. Then, the timeout measurement process is started, and the lock state detection process 11 instructs the timeout measurement process to measure the timeout time read from the process name file 13.
[0028]
Next, the normality confirmation shell 14 instructs the monitoring target process 12 to execute normality response processing (step S302). Then, if the monitoring target process 12 is normal, it sends a normal response to the normality confirmation shell 14 (step S303). Then, the normality confirmation shell 14 notifies the received normal response to the lock state detection process 11 (step S304). Next, when the lock state detection process 11 receives a normal response notification, if there is no time-out notification from the time-out measurement process (if the normal response notification is within the time-out period), it determines a normal response (step (S305) The normality confirmation shell is executed at every execution period of the normality confirmation shell read from the process name file 13 (step S306). Then, the normality confirmation shell 14 executes normality response processing again for the monitoring target process 12 (step S307). Note that if the monitoring target process 12 does not have a response means for executing normality response processing, the termination shell 16 may issue a Kill command to terminate the monitoring target process 12.
[0029]
Next, processing of the lock state detection device when the monitoring target process is in the lock state will be described. FIG. 4 is a diagram illustrating processing of the lock state detection apparatus when the monitoring target process is in the lock state.
First, the lock state detection process 11 includes the process name of the monitoring target process 12 described in the process name file 13, the normality confirmation shell name, the timeout shell name, the termination shell name, the cycle for executing the normality confirmation shell, and the normality. Reads the response time-out time corresponding to the confirmation shell execution. Next, the lock state detection process 11 acquires a process ID using, for example, a ps command based on the process name of the monitoring target process 12 read from the process name file 13.
[0030]
Next, the lock state detection process 11 detects the lock state of the monitoring target process 12 based on the CPU time based on the process confirmation type acquired from the process name file 13 or the monitoring target by executing the normality confirmation shell 14. It is determined whether the lock state of the process 12 is detected. Here, when the process confirmation type indicates “execution of normality confirmation shell”, the lock state detection process 11 uses the acquired process ID and the normality confirmation shell name read from the process name file 13. The normality confirmation shell 14 is executed (step S401), and it is confirmed whether or not the process 12 to be monitored is normal. Here, the lock state detection process 11 turns on the response flag held by the timeout measurement process in order to start the timeout measurement process for measuring the time until the response corresponding to the execution of the normality confirmation shell is notified, Also notifies the timeout measurement process of the timeout time. Then, the timeout measurement process is started, and the lock state detection process 11 instructs the timeout measurement process to measure the timeout time read from the process name file 13.
[0031]
Next, the normality confirmation shell instructs the monitoring target process 12 to execute normality response processing (step S402). Then, the monitoring target process 12 performs an abnormal response to the normality confirmation shell 14 in the locked state (step S403). Then, the normality confirmation shell 14 notifies the received abnormal response to the lock state detection process 11 (step S404). Next, when the lock state detection process 11 receives the notification of the abnormal response, if there is no time-out notification from the time-out measurement process (if the normal response notification is within the time-out period), the lock state detection process 11 determines the abnormal response (step In step S405, the end shell 16 is executed (step S406). Then, the termination shell 16 forcibly terminates the monitoring target process 12 (step S407). Note that if the monitoring target process 12 does not have a response means for executing normality response processing, the termination shell 16 may issue a Kill command to terminate the monitoring target process 12.
[0032]
Next, the processing of the lock state detection apparatus when there is no response from the monitoring target process corresponding to the execution of the normality confirmation shell will be described. FIG. 5 is a diagram illustrating processing of the lock state detection device when there is no response from the monitoring target process.
First, the lock state detection process 11 includes the process name of the monitoring target process 12 described in the process name file 13, the normality confirmation shell name, the timeout shell name, the termination shell name, the cycle for executing the normality confirmation shell, and the normality. Reads the response time-out time corresponding to the confirmation shell execution. Next, the lock state detection process 11 acquires a process ID using, for example, a ps command based on the process name of the monitoring target process 12 read from the process name file 13.
[0033]
Next, the lock state detection process 11 detects the lock state of the monitoring target process 12 based on the CPU time based on the process confirmation type acquired from the process name file 13 or the monitoring target by executing the normality confirmation shell 14. It is determined whether the lock state of the process 12 is detected. Here, when the process confirmation type indicates “execution of normality confirmation shell”, the lock state detection process 11 uses the acquired process ID and the normality confirmation shell name read from the process name file 13. The normality confirmation shell 14 is executed (step S501), and it is confirmed whether or not the process 12 to be monitored is normal. Here, the lock state detection process 11 turns on the response flag held by the timeout measurement process in order to start the timeout measurement process for measuring the time until the response corresponding to the execution of the normality confirmation shell is notified, Also notifies the timeout measurement process of the timeout time. Then, the timeout measurement process is started, and the lock state detection process 11 instructs the timeout measurement process to measure the timeout time read from the process name file 13.
[0034]
Next, the normality confirmation shell instructs the monitoring target process 12 to execute normality response processing (step S502). Here, if a state in which no response is received from the monitoring target process 12 continues, the timeout measurement process determines that the timeout time has elapsed and rewrites the response flag to OFF. When the timeout measurement process confirms that the response flag is OFF, the timeout measurement process issues a signal notifying the lock state detection process 11 that the timeout time has elapsed (step S503). Next, when receiving a signal notifying that the timeout time has elapsed, the lock state detection process 11 executes the timeout shell 15 read from the process name file 13 (step S504). Then, the timeout shell 15 forcibly terminates the normality confirmation shell (step S505). When the time-out shell 15 forcibly terminates the normality confirmation shell, the time-out shell 15 notifies the lock state detection process 11 that the forcible termination has been completed (step S506). Then, the lock state detection process 11 executes the end shell 16 read from the process name file 13 (step S507), and the end shell 16 forcibly ends the monitoring target process 12 (step S508). Note that if the monitoring target process 12 does not have a response means for executing normality response processing, the termination shell 16 may issue a Kill command to terminate the monitoring target process 12.
[0035]
Next, the processing of the lock state detection device when determining whether or not the monitoring target process is locked based on the CPU usage time of the monitoring target process will be described. FIG. 6 is a diagram illustrating processing of the lock state detection device when determining the lock state based on the CPU usage time of the monitoring target process.
First, the lock state detection process 11 includes the process name of the monitoring target process 12 described in the process name file 13, the normality confirmation shell name, the timeout shell name, the termination shell name, the cycle for executing the normality confirmation shell, and the normality. The response timeout time corresponding to the confirmation shell execution, the process confirmation type, and the CPU usage time maximum value (threshold value) are read. Next, the lock state detection process 11 acquires the process ID of the monitoring target process 12 using the ps command based on the process name of the monitoring target process 12 read from the process name file 13 (step S601).
[0036]
Next, the lock state detection process 11 detects the lock state of the monitoring target process 12 based on the CPU time based on the process confirmation type acquired from the process name file 13 or the monitoring target by executing the normality confirmation shell 14. It is determined whether the lock state of the process 12 has been detected (step S602). When the process confirmation type indicates “CPU time monitoring”, the lock state detection process 11 detects the lock state of the monitoring target process 12 based on the CPU time, and acquires the process ID acquired in step S601. Is confirmed in the process information storage file 17. Then, the CPU usage time of the monitoring target process 12 described in the process information storage file 17 is confirmed at regular intervals. Then, the lock state detection process 11 obtains the total CPU usage time by confirming the total of the CPU usage time twice, and after confirming the difference in the total CPU usage time (the total CPU usage time) CPU usage time increased until the total CPU usage time is confirmed) is calculated.
[0037]
Then, the CPU usage time difference calculated is compared with the CPU usage time maximum value read from the process name file 13. When the calculated difference in CPU usage time exceeds the maximum CPU usage time, the lock state detection process 11 executes the end shell 16 read from the process name file 13 (step S603), and the end shell 16 Forcibly terminates the monitored process 12.
[0038]
The above-described lock state detection device has a computer system inside. The process described above is stored in a computer-readable recording medium in the form of a program, and the above process is performed by the computer reading and executing this program. Here, the computer-readable recording medium means a magnetic disk, a magneto-optical disk, a CD-ROM, a DVD-ROM, a semiconductor memory, or the like. Alternatively, the computer program may be distributed to the computer via a communication line, and the computer that has received the distribution may execute the program.
The above-mentioned process is an execution unit under the management of the OS of the program. In the computer processing of the lock state detection device, the main memory reads and stores a program recorded on a recording medium such as a hard disk, and the CPU executes the program stored in the main memory. Further, the CPU reads the data for the executed program from the main memory and writes the data for the executed program into the main memory. A plurality of processes, which are processing execution units for each computer program, are processed in parallel under the management of the OS.
[0039]
【The invention's effect】
According to the present invention, the monitoring target process responds based on the execution instruction of the normality response process, and the normality confirmation command instructs the monitoring target process to execute the normality response process and receives the response. Then, the lock state detection process executes a normality confirmation command, and detects the lock state of the monitoring process based on the response notified from the normality confirmation command. As a result, the locked state of the monitored process can be detected more accurately as compared to the execution of the ps command, which is a method for merely checking whether the monitored process is activated on the UNIX (registered trademark) system.
[0040]
According to the present invention, the lock state detection process executes a time-out command when there is no response notification even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal Alternatively, the end command is executed in any case where there is no response notification even after a certain period of time has elapsed since the normality confirmation command was executed. As a result, the locked state of the monitored process can be automatically detected and forcibly terminated without the user having to manually execute the ps command or execute a command for operating the monitored process from the GUI. I can do it. In addition, since the lock state of the monitoring target process can be automatically detected, the user can find the monitoring target process in the locked state at an early stage and take actions such as process restart.
[0041]
Further, according to the present invention, the lock state detection for acquiring the CPU usage time of the monitoring target process and detecting the lock state of the monitoring target process based on whether the CPU usage time exceeds a predetermined threshold. A lock state detection device comprising a process. As a result, the locked state of the monitored process can be automatically detected without the user having to manually execute the ps command or execute a command for operating the monitored process from the GUI. In addition, since the lock state of the monitoring target process can be automatically detected, the user can find the monitoring target process in the locked state at an early stage and take actions such as process restart.
[0042]
Further, according to the present invention, the lock state detection device described above includes a termination command for forcibly terminating the process to be monitored, and the lock state detection process executes the termination command when the CPU usage time exceeds a threshold value. To do. Thereby, when the monitoring target process is locked, the monitoring target process can be automatically forcibly terminated.
[0043]
According to the present invention, in the above-described lock state detection device, the normality confirmation command is a command prepared for a specific process to be monitored. Thus, instead of the normality confirmation command for executing the execution instruction of the normality response process for a plurality of monitoring target processes, the execution instruction for the normality response process is executed for one specific monitoring target process. Since it is sufficient to create a normality confirmation command, the user can easily check the normality compared to creating a normality confirmation command that performs the execution instruction of normality response processing for multiple monitored processes. You can create commands.
[Brief description of the drawings]
FIG. 1 is a schematic block diagram showing a configuration of a lock state detection device according to an embodiment of the present invention.
FIG. 2 is a diagram showing data contents described in a process name file according to an embodiment of the present invention.
FIG. 3 is a diagram showing processing of the lock state detection device when the monitoring target process is normal according to the embodiment of the present invention.
FIG. 4 is a diagram illustrating processing of the lock state detection device when the monitoring target process is in the lock state according to the embodiment of the present invention.
FIG. 5 is a diagram showing processing of the lock state detection device when there is no response from the monitoring target process according to the embodiment of the present invention.
FIG. 6 is a diagram illustrating processing of the lock state detection device when determining the lock state based on the CPU usage time of the monitoring target process according to the embodiment of the present invention.
[Explanation of symbols]
1 Lock state detection device
11 Lock state detection process
12 Processes to be monitored
13 Process name file
14 Normality confirmation shell
15 Timeout shell
16 Exit shell
17 Process information storage file

Claims (15)

正常性応答処理の実行指示に基づいて応答を行なう監視対象プロセスと、
前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける正常性確認コマンドと、
前記正常性確認コマンドを実行し、当該正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出するロック状態検出プロセスと、
を備えることを特徴とするロック状態検出装置。
A monitored process that responds based on an instruction to execute normality response processing;
A normality confirmation command for instructing the monitored process to execute normality response processing and receiving the response;
A lock state detection process for executing the normality confirmation command and detecting the lock state of the monitoring process based on the response notified from the normality confirmation command;
A lock state detection device comprising:
実行された前記正常性確認コマンドを強制終了するタイムアウトコマンドと、
前記監視対象プロセスを強制終了する終了コマンドと、
を備え、
前記ロック状態検出プロセスは前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行する
ことを特徴とする請求項1に記載のロック状態検出装置。
A timeout command for forcibly terminating the executed health check command;
A termination command for forcibly terminating the monitored process;
With
The lock state detection process executes the time-out command when there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal or the normal 2. The lock state detecting apparatus according to claim 1, wherein the end command is executed in any case where the response is not notified even after a predetermined time has elapsed since the execution of the sex confirmation command.
監視対象プロセスのロック状態検出装置であって、
前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出するロック状態検出プロセス
を備えることを特徴とするロック状態検出装置。
A device for detecting a lock state of a monitored process,
A lock state detection process for acquiring a CPU usage time of the monitoring target process and detecting a lock state of the monitoring target process based on whether the CPU usage time exceeds a predetermined threshold; A lock state detection device.
前記監視対象プロセスを強制終了する終了コマンドを備え、
前記ロック状態検出プロセスは、前記CPU使用時間が前記閾値を超えている場合に前記終了コマンドを実行する
ことを特徴する請求項3に記載のロック状態検出装置。
A termination command for forcibly terminating the monitored process;
The lock state detection apparatus according to claim 3, wherein the lock state detection process executes the end command when the CPU usage time exceeds the threshold value.
前記正常性確認コマンドは特定の前記監視対象プロセス用に用意されたコマンドであることを特徴とする請求項1から請求項4のいずれかに記載のロック状態検出装置。5. The lock state detection apparatus according to claim 1, wherein the normality confirmation command is a command prepared for a specific process to be monitored. 正常性応答処理の実行指示に基づいて応答を行なう監視対象プロセスのロック状態検出方法であって、
ロック状態検出プロセスが、正常性確認コマンドを実行する過程と、
正常性確認コマンドが、前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を受け付ける過程と、
前記ロック状態検出プロセスが、前記正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出する過程と、
を有することを特徴とするロック状態検出方法。
A method for detecting a lock state of a monitored process that makes a response based on an instruction to execute normality response processing,
The lock state detection process executes a health check command;
A process in which a normality confirmation command instructs the monitoring target process to execute normality response processing and receives a response;
The lock state detection process detecting the lock state of the monitoring process based on the response notified from the normality confirmation command;
A lock state detection method characterized by comprising:
前記ロック状態検出プロセスが、前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行する過程と、
前記タイムアウトコマンドが、実行された前記正常性確認コマンドを強制終了する過程と、
前記終了コマンドが、前記監視対象プロセスを強制終了する過程と、
を有することを特徴とする請求項6に記載のロック状態検出方法。
The lock state detection process executes the time-out command when there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal or A process of executing the end command in any case where there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command;
The time-out command forcibly terminating the executed normality confirmation command;
The termination command forcibly terminating the monitored process;
The lock state detecting method according to claim 6, further comprising:
監視対象プロセスのロック状態検出方法であって、
ロック状態検出プロセスが、前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出する過程
を有することを特徴とするロック状態検出方法。
A method for detecting a lock state of a monitored process,
The lock state detection process acquires the CPU usage time of the monitoring target process and detects the lock state of the monitoring target process based on whether the CPU usage time exceeds a predetermined threshold. A lock state detection method comprising:
前記ロック状態検出プロセスが、前記CPU使用時間が前記閾値を超えている場合に終了コマンドを実行する過程と、
前記終了コマンドが、前記監視対象プロセスを強制終了する過程と、
を有することを特徴する請求項8に記載のロック状態検出方法。
The lock state detection process executing a termination command when the CPU usage time exceeds the threshold;
The termination command forcibly terminating the monitored process;
The lock state detection method according to claim 8, comprising:
前記正常性確認コマンドは特定の前記監視対象プロセス用に用意されたコマンドであることを特徴とする請求項6から請求項9のいずれかに記載のロック状態検出方法。The lock state detection method according to claim 6, wherein the normality confirmation command is a command prepared for a specific process to be monitored. 監視対象プロセスのロック状態を検出するロック状態検出装置のコンピュータに実行させるプログラムであって、
ロック状態検出プロセスが、正常性確認コマンドを実行する過程と、
正常性確認コマンドが、前記監視対象プロセスに正常性応答処理の実行指示を行ない、その応答を前記監視対象プロセスより受け付ける過程と、
前記ロック状態検出プロセスが、前記正常性確認コマンドから通知される前記応答に基づいて、前記監視プロセスのロック状態を検出する過程と、
の処理をコンピュータに実行させるプログラム。
A program to be executed by a computer of a lock state detection device that detects a lock state of a monitored process,
The lock state detection process executes a health check command;
A normality confirmation command instructs the monitoring target process to execute normality response processing, and receives a response from the monitoring target process;
The lock state detection process detecting the lock state of the monitoring process based on the response notified from the normality confirmation command;
A program that causes a computer to execute this process.
前記ロック状態検出プロセスが、前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合に前記タイムアウトコマンドを実行し、前記監視対象プロセスからの応答が異常である場合または前記正常性確認コマンドの実行から一定時間経過しても前記応答の通知がない場合のいずれかの場合に前記終了コマンドを実行する過程と、
前記タイムアウトコマンドの実行に基づいて、実行された前記正常性確認コマンドを強制終了する過程と、
前記終了コマンドの実行に基づいて、前記監視対象プロセスを強制終了する過程と、
の処理をコンピュータに実行させる請求項11に記載のプログラム。
The lock state detection process executes the time-out command when there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command, and the response from the monitored process is abnormal or A process of executing the end command in any case where there is no notification of the response even after a lapse of a certain time from the execution of the normality confirmation command;
A process of forcibly terminating the executed normality confirmation command based on execution of the timeout command;
A process of forcibly terminating the monitored process based on execution of the termination command;
The program of Claim 11 which makes a computer perform the process of.
監視対象プロセスのロック状態を検出するロック状態検出装置のコンピュータに実行させるプログラムであって、
前記監視対象プロセスのCPU使用時間を取得し、当該CPU使用時間が予め定められた閾値を超えているか否かに基づいて、前記監視対象プロセスのロック状態を検出する過程
の処理をコンピュータに実行させるプログラム。
A program to be executed by a computer of a lock state detection device that detects a lock state of a monitored process,
The CPU usage time of the monitoring target process is acquired, and based on whether or not the CPU usage time exceeds a predetermined threshold, the computer is caused to execute a process of detecting the lock state of the monitoring target process. program.
前記ロック状態検出プロセスが、前記CPU使用時間が前記閾値を超えている場合に終了コマンドを実行する過程と、
前記終了コマンドの実行に基づいて、前記監視対象プロセスを強制終了する過程と、
の処理をコンピュータに実行させる請求項13に記載のプログラム。
The lock state detection process executing a termination command when the CPU usage time exceeds the threshold;
A process of forcibly terminating the monitored process based on execution of the termination command;
The program of Claim 13 which makes a computer perform the process of.
特定の前記監視対象プロセス用に用意された前記正常性確認コマンドを実行させる請求項11から請求項14に記載のプログラム。The program according to any one of claims 11 to 14, wherein the normality confirmation command prepared for a specific process to be monitored is executed.
JP2003209783A 2003-08-29 2003-08-29 Lock status detection device and lock status detection method and its program Pending JP2005078122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003209783A JP2005078122A (en) 2003-08-29 2003-08-29 Lock status detection device and lock status detection method and its program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003209783A JP2005078122A (en) 2003-08-29 2003-08-29 Lock status detection device and lock status detection method and its program

Publications (1)

Publication Number Publication Date
JP2005078122A true JP2005078122A (en) 2005-03-24

Family

ID=34402599

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003209783A Pending JP2005078122A (en) 2003-08-29 2003-08-29 Lock status detection device and lock status detection method and its program

Country Status (1)

Country Link
JP (1) JP2005078122A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003641A (en) * 2007-06-20 2009-01-08 Victor Co Of Japan Ltd Content processor, its method, and its program
JP2009003640A (en) * 2007-06-20 2009-01-08 Victor Co Of Japan Ltd Content processor, its method, and its program
JP2011141786A (en) * 2010-01-08 2011-07-21 Oki Networks Co Ltd Cpu monitoring device and cpu monitoring program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009003641A (en) * 2007-06-20 2009-01-08 Victor Co Of Japan Ltd Content processor, its method, and its program
JP2009003640A (en) * 2007-06-20 2009-01-08 Victor Co Of Japan Ltd Content processor, its method, and its program
JP2011141786A (en) * 2010-01-08 2011-07-21 Oki Networks Co Ltd Cpu monitoring device and cpu monitoring program

Similar Documents

Publication Publication Date Title
US7412631B2 (en) Methods and structure for verifying domain functionality
TWI632462B (en) Switching device and method for detecting i2c bus
JP2007323193A (en) System, method and program for detecting abnormality of performance load
JP2010086364A (en) Information processing device, operation state monitoring device and method
JPWO2012046293A1 (en) Fault monitoring apparatus, fault monitoring method and program
WO2020010890A1 (en) Method and system for monitoring resource utilization rate of server cpu based on bmc
TW201248513A (en) Board automatic test method and system
KR100985959B1 (en) Quantitative measurement of the autonomic capabilities of computing systems
JP2006268208A (en) Failure diagnosing circuit, information processor equipped with the same, failure diagnosing system, and failure diagnosing program
WO2010113212A1 (en) Memory leak monitoring device and method
JP2006268515A (en) Pci card trouble management system
JP6504610B2 (en) Processing device, method and program
JP2005078122A (en) Lock status detection device and lock status detection method and its program
JP2020021432A (en) Control method, control unit, and control program
JP2010003132A (en) Information processor, and fault detection method of input/output device thereof, and program thereof
JP5683354B2 (en) Monitoring device and monitoring method
JP6476978B2 (en) Log information collection program, log information collection device, and log information collection method
US8332562B2 (en) System to reduce the time and complexity of self configuring systems
JP2009199121A (en) Information processor, communication information sampling method, and program
JP5997005B2 (en) Information processing apparatus, process normal end determination method, and program
JP2007212454A (en) Method and device using service for performing at least one of start and monitoring of data format process
JP7298694B2 (en) Abnormality detection device, control method, and program
JP2006201890A (en) Device for taking countermeasures against program abnormality
JP6919399B2 (en) Judgment program, information processing device, and judgment method
JP2002007172A (en) Stall monitoring device, stall monitoring method and recording medium recorded with stall monitor program