patchcheck1.2を使用してSolarisのパッチの適用状態を非対話的にチェックしレポートする方法を紹介します。
対話的なチェックであれば Patch Pro で簡単にチェックすることができます。
■ ソフトウェアの入手
patchcheck1.2をダウンロードします。
patchcheck1.2を正常に動作させるには perl5.0以上が必要です。たぶん標準で入っていると思いますが、ない場合はsunfreeware.comでパッケージを入手してください。
■ インストール(解凍・展開して適当な場所へ配置する)
# uncompress patchcheck_1.2.tar.Z # tar xvf patchcheck_1.2.tar x patchcheck_1.2, 0 bytes, 0 テープブロック x patchcheck_1.2/COPYRIGHT, 8299 bytes, 17 テープブロック x patchcheck_1.2/patchk.pl, 69755 bytes, 137 テープブロック x patchcheck_1.2/userguide, 11921 bytes, 24 テープブロック # mkdir -p /script/patch # cp -r patchcheck_1.2 /script/patch |
patchdiag.xref
というファイル名で保存してください。保存場所はpatchk.plスクリプトと同じディレクトリです。(この例の場合は /script/patch/patchcheck_1.2 ディレクトリ)patchdiag.xref
)をwgetコマンドで取得しています。# /usr/sfw/bin/wget -O /script/patch/patchcheck_1.2/patchdiag.xref 'http://sunsolve.sun.com/pub-cgi/pdownload.pl?target=patchdiag.xref&method=H' |
# /usr/sfw/bin/wget -O /script/patch/patchcheck_1.2/patchdiag.xref 'http://sunsolve.sun.com/pub-cgi/pdownload.pl?target=patchdiag.xref&method=H' --21:52:27-- http://sunsolve.sun.com/pub-cgi/pdownload.pl?target=patchdiag.xref&method=H => `/script/patch/patchcheck_1.2/patchdiag.xref' jp.sunsolve.sun.com:80 に接続しています... 接続しました! HTTP による接続要求を送信しました、応答を待っています... 200 OK 長さ: 1,183,860 [text/plain] 0K .......... .......... .......... .......... .......... 4% @ 32.77KB/s 50K .......... .......... .......... .......... .......... 8% @ 40.98KB/s 100K .......... .......... .......... .......... .......... 12% @ 57.47KB/s 150K .......... .......... .......... .......... .......... 17% @ 61.73KB/s 200K .......... .......... .......... .......... .......... 21% @ 74.63KB/s 250K .......... .......... .......... .......... .......... 25% @ 75.76KB/s 300K .......... .......... .......... .......... .......... 30% @ 61.73KB/s 350K .......... .......... .......... .......... .......... 34% @ 49.02KB/s 400K .......... .......... .......... .......... .......... 38% @ 64.02KB/s 450K .......... .......... .......... .......... .......... 43% @ 51.39KB/s 500K .......... .......... .......... .......... .......... 47% @ 47.35KB/s 550K .......... .......... .......... .......... .......... 51% @ 33.56KB/s 600K .......... .......... .......... .......... .......... 56% @ 55.56KB/s 650K .......... .......... .......... .......... .......... 60% @ 72.46KB/s 700K .......... .......... .......... .......... .......... 64% @ 80.78KB/s 750K .......... .......... .......... .......... .......... 69% @ 52.03KB/s 800K .......... .......... .......... .......... .......... 73% @ 53.71KB/s 850K .......... .......... .......... .......... .......... 77% @ 60.31KB/s 900K .......... .......... .......... .......... .......... 82% @ 71.43KB/s 950K .......... .......... .......... .......... .......... 86% @ 80.78KB/s 1000K .......... .......... .......... .......... .......... 90% @64.77 KB/s 1050K .......... .......... .......... .......... .......... 95% @51.60 KB/s 1100K .......... .......... .......... .......... .......... 99% @89.93 KB/s 1150K ...... 100% @ 679.25 KB/s 21:52:50 (56.56 KB/s) - `/script/patch/patchcheck_1.2/patchdiag.xref' を保存しました [1183860/1183860] |
# pwd /script/patch/patchcheck_1.2 # perl patchk.pl processing... ================================================================ System Name: blade SunOS Vers: 5.9 Arch: sparc Cross Reference File Date: Sep/22/03 Patch Check Version: 1.1 ================================================================ Report Note: Recommended patches are considered the most important and highly recommended patches that avoid the most critical system, user, or security related bugs which have been reported and fixed to date. A patch not listed on the recommended list does not imply that it should not be used if needed. Some patches listed in this report may have certain platform specific or application specific dependencies and thus may not be applicable to your system. It is important to carefully review the README file of each patch to fully determine the applicability of any patch with your system. ================================================================ INSTALLED PATCHES Patch Installed Latest Synopsis ID Revision Revision ------ --------- -------- ---------------------------------------------------- 112233 08 CURRENT SunOS 5.9: Kernel Patch 112617 02 CURRENT CDE 1.5: rpc.cmsd patch 112622 09 CURRENT SunOS 5.9: M64 Graphics Patch 112661 05 CURRENT SunOS 5.9: IIIM and X Input & Output Method patch 112764 02 06 SunOS 5.9: Sun Quad FastEthernet qfe driver 112785 24 CURRENT X11 6.6.1: Xsun patch ... ... ...省略 ================================================================ # |
patchdiag.xref
の# cat patchcheck #!/bin/sh /usr/sfw/bin/wget -O /script/patch/patchcheck_1.2/patchdiag.xref 'http:// sunsolve.sun.com/pub-cgi/pdownload.pl?target=patchdiag.xref&method=H'> /dev/null 2>&1 /script/patch/patchcheck_1.2/patchk.pl > /script/patch/patchcheck_1.2/patch_report mailx -s patch_report xxx@yyy.com < /script/patch/patchcheck_1.2/patch_report |
# crontab -l ... ... 0 8 * * 0 /script/patchcheck |