batica memo

ちょっとしたコマンドや関数など、1つの記事にするほどでもないけど、調べたこととしてメモしておきたいものを書いていきます。
記事にする時間が無い時にメモとして書くこともあります。
後で記事にしたら消します。

所有者限定モードのためこのボードには投稿できません ボードとは?

【Zabbix】 Template OS Windows by Zabbix agentのサービス監視除外設定

https://note.com/nerone1024/n/ne8c695a5419b

### 変更前
^(?:|RemoteRegistry|MMCSS|gupdate|SysmonLog|clr_optimization_v.+|clr_optimization_v.+|sppsvc|gpsvc|Pml Driver HPZ12|Net Driver HPZ12|MapsBroker|IntelAudioService|Intel\(R\) TPM Provisioning Service|dbupdate|DoSvc)$

### 変更後
#### WpnUserServiceの除外
#### CDPUserServiceの除外
#### BITSの除外
^(?:(CDP|Wpn)User[_A-Za-z0-9]+|BITS|RemoteRegistry|MMCSS|gupdate|SysmonLog|clr_optimization_v.+|clr_optimization_v.+|sppsvc|gpsvc|Pml Driver HPZ12|Net Driver HPZ12|MapsBroker|IntelAudioService|Intel\(R\) TPM Provisioning Service|dbupdate|DoSvc)$

【Apache】server-statusをコマンドで出力する

Apache 2.4 server-status / server-info

[root]
$ watch -n 1 "wget -q http://127.0.0.1/server-status?auto -O -"

$ watch -n 1 "curl 'http://127.0.0.1/server-status?auto'"

【Zabbix】zabbixのホームディレクトリ

https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/mysql_agent?at=refs/heads/release/5.0

「Template DB MySQL by Zabbix agent」を使うために設定を行っている。

Create .my.cnf in the home directory of Zabbix agent for Linux (/var/lib/zabbix by default ) or my.cnf in c:\ for Windows. The file must have three strings:

デフォルトから変更した記憶が無いが、ホームディレクトリを確認する。

[root]
$ cat /etc/passwd | grep zabbix
zabbix:x:988:984:Zabbix Monitoring System:/var/lib/zabbix:/sbin/nologin

ホームディレクトリが無い。

[root]
$ ls -l /var/lib/zabbix
ls: '/var/lib/zabbix' にアクセスできません: そのようなファイルやディレクトリはありません

https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/403436-no-folder-var-lib-zabbix

Create the directory /var/lib/zabbix yourself. Permissions should be owned by the zabbix user and read/write by the zabbix user.

自分で作成すればよいらしい。

[root]
$ mkdir /var/lib/zabbix
$ chown zabbix:zabbix /var/lib/zabbix

【Zabbix】MySQLのパスワードを変更したらWeb GUI画面に入れなくなった

https://zabbix83.rssing.com/chan-59764673/article76.html
https://saw.hateblo.jp/entry/2019/03/28/183444

⇒mysqlのユーザに対するパスワード、/etc/zabbix/zabbix_server.confだけではなく、/etc/zabbix/web/zabbix.conf.phpにもパスワードが書かれるため変更する。

エラー内容

MySQL database "zabbix" on "localhost" is not available: Access denied for user 'zabbix'@'localhost' (using password: YES)

【コマンドプロンプト】スタティックルートの設定

「Static Routing - route add」ネットワークエンジニアとして (参照日:2022-01-31)
* コマンドプロンプトを管理者権限で開く
* 以下コマンドを入力

route -p add {NETWORK} mask {SUBNETMASK} {DEFAULTGATEWAY}
ex)
route -p add 192.168.0.0 mask 255.255.255.0 192.168.0.254