mib 파일 등록하기 (ubuntu에 넣는 방법)
저는 다운로드 받은 파일에 확장자가 txt가 붙었네요.
확장자가 붙은 경우 txt 확장자를 제거해주시거나, ubuntu로 옮긴 후 확장자 제거해 주세요.
1. 윈도우즈
C:\Users\test\Downloads>scp .\FORTINET-CORE-MIB.txt .\FORTINET-FORTIGATE-MIB.txt logmgmt@192.168.0.100:~
ID@192.168.0.100's password:
FORTINET-CORE-MIB.txt 100% 15KB 4.9MB/s 00:00
FORTINET-FORTIGATE-MIB.txt 100% 397KB 24.2MB/s 00:00
C:\Users\test\Downloads>
2. ubuntu
logmgmt@syslogserver:~$ ls -al
total 8492
drwxr-x--- 14 logmgmt logmgmt 4096 2월 6 15:55 .
drwxr-xr-x 3 root root 4096 11월 28 13:53 ..
-rw------- 1 logmgmt logmgmt 43176 2월 6 12:26 .bash_history
-rw-r--r-- 1 logmgmt logmgmt 220 11월 28 13:53 .bash_logout
-rw-r--r-- 1 logmgmt logmgmt 3771 11월 28 13:53 .bashrc
drwx------ 11 logmgmt logmgmt 4096 1월 12 16:59 .cache
drwx------ 11 logmgmt logmgmt 4096 11월 28 18:07 .config
-rw------- 1 logmgmt logmgmt 20 12월 28 10:44 .lesshst
drwx------ 5 logmgmt logmgmt 4096 1월 12 17:15 .local
-rw-r--r-- 1 logmgmt logmgmt 807 11월 28 13:53 .profile
-rw------- 1 logmgmt logmgmt 5 1월 12 16:44 .python_history
-rw-r--r-- 1 logmgmt logmgmt 0 11월 28 18:04 .sudo_as_admin_successful
-rw-rw-r-- 1 logmgmt logmgmt 254 12월 22 17:57 .wget-hsts
-rw-rw-r-- 1 logmgmt logmgmt 15309 2월 6 15:55 FORTINET-CORE-MIB.txt
-rw-rw-r-- 1 logmgmt logmgmt 406521 2월 6 15:55 FORTINET-FORTIGATE-MIB.txt
-rw-rw-r-- 1 logmgmt logmgmt 8134656 1월 15 14:37 elastalert.txt
drwx------ 5 logmgmt logmgmt 4096 12월 26 17:51 snap
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 공개
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 다운로드
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 문서
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 바탕화면
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 비디오
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 사진
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 음악
drwxr-xr-x 2 logmgmt logmgmt 4096 11월 28 16:14 템플릿
logmgmt@syslogserver:~$ sudo mv ./FORTINET-CORE-MIB.txt ./FORTINET-FORTIGATE-MIB.txt /usr/share/snmp/mibs/ietf
[sudo] password for logmgmt:
logmgmt@syslogserver:~$ cd /usr/share/snmp/mibs/ietf
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ ls -al | grep FORTINET
-rw-rw-r-- 1 logmgmt logmgmt 15309 2월 6 15:55 FORTINET-CORE-MIB.txt
-rw-rw-r-- 1 logmgmt logmgmt 406521 2월 6 15:55 FORTINET-FORTIGATE-MIB.txt
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ sudo mv ./FORTINET-CORE-MIB.txt ./FORTINET-CORE-MIB
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ sudo mv ./FORTINET-FORTIGATE-MIB.txt ./FORTINET-FORTIGATE-MIB
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ ls -al | grep FORTINET
-rw-rw-r-- 1 logmgmt logmgmt 15309 2월 6 15:55 FORTINET-CORE-MIB
-rw-rw-r-- 1 logmgmt logmgmt 406521 2월 6 15:55 FORTINET-FORTIGATE-MIB
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ sudo chown root:root ./FORTINET-*
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$ ls -al | grep FORTINET
-rw-rw-r-- 1 root root 15309 2월 6 15:55 FORTINET-CORE-MIB
-rw-rw-r-- 1 root root 406521 2월 6 15:55 FORTINET-FORTIGATE-MIB
logmgmt@syslogserver:/usr/share/snmp/mibs/ietf$
2.1 mib 파일명 체크: 2.1.3의 확장자 없애기를 하셔야 에러가 없습니다.
2.1.1 확장자 txt 일 경우
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-CORE-MIB ./FORTINET-CORE-MIB.txt
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-FORTIGATE-MIB ./FORTINET-FORTIGATE-MIB.txt
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl restart snmp-exporter.service
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl status snmp-exporter.service | more
● snmp-exporter.service - Prometheus SNMP Exporter Service
Loaded: loaded (/etc/systemd/system/snmp-exporter.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 15:29:18 KST; 23s ago
Main PID: 2631842 (snmp_exporter)
Tasks: 9 (limit: 19052)
Memory: 10.7M
CPU: 136ms
CGroup: /system.slice/snmp-exporter.service
└─2631842 /usr/local/bin/snmp_exporter --config.file=/opt/snmp_exporter/snmp.yml
2월 06 15:29:18 syslogserver systemd[1]: Started Prometheus SNMP Exporter Service.
2월 06 15:29:18 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:18.664Z caller=main.go:194 level=info msg="Starting snmp_exporter" version="(version=0.25.0, branch=HEAD, revision=9c42d6c87
4d479314e612bca69558c81f8e26287)" concurrency=1
2월 06 15:29:18 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:18.664Z caller=main.go:195 level=info build_context="(go=go1.21.5, platform=linux/amd64, user=root@880115266f70, date=202312
10-10:05:18, tags=netgo)"
2월 06 15:29:18 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:18.758Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
2월 06 15:29:18 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:18.758Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
2월 06 15:29:23 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:23.950Z caller=collector.go:393 level=info auth=public_v2 target=192.168.104.1 module=fortinet_fortigate msg="Error scraping
target" err="error walking target 192.168.104.1: marshal: marshalPDU: unable to marshal varbind list: unable to marshal OID: Invalid object identifier"
2월 06 15:29:38 syslogserver snmp_exporter[2631842]: ts=2024-02-06T06:29:38.952Z caller=collector.go:393 level=info auth=public_v2 target=192.168.104.1 module=fortinet_fortigate msg="Error scraping
target" err="error walking target 192.168.104.1: marshal: marshalPDU: unable to marshal varbind list: unable to marshal OID: Invalid object identifier"
root@syslogserver:/usr/share/snmp/mibs/ietf#
2.1.2 확장자 mib 일 경우
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-CORE-MIB.txt ./FORTINET-CORE-MIB.mib
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-FORTIGATE-MIB.txt ./FORTINET-FORTIGATE-MIB.mib
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl restart snmp-exporter.service
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl status snmp-exporter.service | more
● snmp-exporter.service - Prometheus SNMP Exporter Service
Loaded: loaded (/etc/systemd/system/snmp-exporter.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 15:33:20 KST; 3s ago
Main PID: 2631948 (snmp_exporter)
Tasks: 8 (limit: 19052)
Memory: 15.9M
CPU: 142ms
CGroup: /system.slice/snmp-exporter.service
└─2631948 /usr/local/bin/snmp_exporter --config.file=/opt/snmp_exporter/snmp.yml
2월 06 15:33:20 syslogserver systemd[1]: Started Prometheus SNMP Exporter Service.
2월 06 15:33:20 syslogserver snmp_exporter[2631948]: ts=2024-02-06T06:33:20.549Z caller=main.go:194 level=info msg="Starting snmp_exporter" version="(version=0.25.0, branch=HEAD, revision=9c42d6c87
4d479314e612bca69558c81f8e26287)" concurrency=1
2월 06 15:33:20 syslogserver snmp_exporter[2631948]: ts=2024-02-06T06:33:20.549Z caller=main.go:195 level=info build_context="(go=go1.21.5, platform=linux/amd64, user=root@880115266f70, date=202312
10-10:05:18, tags=netgo)"
2월 06 15:33:20 syslogserver snmp_exporter[2631948]: ts=2024-02-06T06:33:20.667Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
2월 06 15:33:20 syslogserver snmp_exporter[2631948]: ts=2024-02-06T06:33:20.667Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
2월 06 15:33:23 syslogserver snmp_exporter[2631948]: ts=2024-02-06T06:33:23.951Z caller=collector.go:393 level=info auth=public_v2 target=192.168.104.1 module=fortinet_fortigate msg="Error scraping
target" err="error walking target 192.168.104.1: marshal: marshalPDU: unable to marshal varbind list: unable to marshal OID: Invalid object identifier"
root@syslogserver:/usr/share/snmp/mibs/ietf#
2.1.3 확장자가 없을 경우
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-CORE-MIB.mib ./FORTINET-CORE-MIB
root@syslogserver:/usr/share/snmp/mibs/ietf# mv ./FORTINET-FORTIGATE-MIB.mib ./FORTINET-FORTIGATE-MIB
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl restart snmp-exporter.service
root@syslogserver:/usr/share/snmp/mibs/ietf# systemctl status snmp-exporter.service | more
● snmp-exporter.service - Prometheus SNMP Exporter Service
Loaded: loaded (/etc/systemd/system/snmp-exporter.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 15:36:57 KST; 6s ago
Main PID: 2631988 (snmp_exporter)
Tasks: 8 (limit: 19052)
Memory: 17.4M
CPU: 125ms
CGroup: /system.slice/snmp-exporter.service
└─2631988 /usr/local/bin/snmp_exporter --config.file=/opt/snmp_exporter/snmp.yml
2월 06 15:36:57 syslogserver systemd[1]: Started Prometheus SNMP Exporter Service.
2월 06 15:36:57 syslogserver snmp_exporter[2631988]: ts=2024-02-06T06:36:57.412Z caller=main.go:194 level=info msg="Starting snmp_exporter" version="(version=0.25.0, branch=HEAD, revision=9c42d6c87
4d479314e612bca69558c81f8e26287)" concurrency=1
2월 06 15:36:57 syslogserver snmp_exporter[2631988]: ts=2024-02-06T06:36:57.412Z caller=main.go:195 level=info build_context="(go=go1.21.5, platform=linux/amd64, user=root@880115266f70, date=202312
10-10:05:18, tags=netgo)"
2월 06 15:36:57 syslogserver snmp_exporter[2631988]: ts=2024-02-06T06:36:57.507Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9116
2월 06 15:36:57 syslogserver snmp_exporter[2631988]: ts=2024-02-06T06:36:57.507Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9116
root@syslogserver:/usr/share/snmp/mibs/ietf#
'기술 노트 > ubuntu' 카테고리의 다른 글
InfluxDB 2.x 설치하기 (1) | 2024.03.15 |
---|---|
sudo 권한 부여하기 (0) | 2024.03.11 |
elastalert2 rules 설정 (0) | 2024.01.15 |
elastalert2 설치하기 (0) | 2024.01.15 |
grafana 알람 설정 (0) | 2024.01.08 |