批處理 方式安裝配置SNMP服務

最近公司在上 Nagios 監控,需要批量對Windows 平臺啓用SNMP服務。

閒言少敘 立馬正題

終端計算機批量啓用SNMP 服務並進行配置。
1、利用DISM 進行SNMP 服務安裝。
ECHO off
cd %~sdp0
start /wait dism /online /enable-feature /featurename:SNMP
regedit /s "SNMP.reg"
將上述文件保存爲SNMP.bat 即可
參考文檔:https://www.raymond.cc/blog/add-or-remove-windows-features-through-the-command-prompt/

2、對SNMP 服務的配置,選用直接修改註冊表的方式。一下文件直接保存爲.reg 方便調用


Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\ValidCommunities]
"Public"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers]
"3"="192.168.1.1"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章