在 CentOS 上监控 IBM Informix 的状态,常见方式可以分为 命令行工具、系统脚本 和 第三方监控 三类。下面给你一套实用方案。
onstat -
或
onstat -p
常见状态说明:
On-Line:正常运行Quiescent:静默模式Shutting Down:正在关闭Off-Line:未运行onstat -g cfg
或
ps -ef | grep oninit
cd $INFORMIXDIR/tmp
ls -l *.log
通常日志文件:
onstat -g msg
systemctl status informix
(如果做了 systemd 服务)
或
ps aux | grep oninit
top
htop
iostat -x 1
vmstat 1
Informix 关键进程:
oninitondmon#!/bin/bash
status=$(onstat - | awk 'NR==1{print $3}')
if [ "$status" != "On-Line" ]; then
echo "Informix NOT online: $status" | mail -s "Informix Alert" admin@xxx.com
fi
加入 crontab:
*/5 * * * * /opt/scripts/check_informix.sh
onstat -g ses
onstat -g lod
onstat -d
onstat -x
onstat + shell 脚本采集| 问题 | 命令 |
|---|---|
| 数据库起不来 | onstat - |
| 空间满 | onstat -d |
| 锁死 | onstat -g lod |
| 慢查询 | onstat -g ses |
| 日志错误 | onstat -g msg |
如果你愿意,我可以:
你现在是 单机还是集群(HDR / RSS)?