snmpset에 대한 질문..

firehole의 이미지

안녕하세요?

저는 snmpset 명령을 테스트 하고 있습니다.

다름이 아니라 게시판의 내용을 참고로 테스트 해봤습니다.

우선

Quote:
[root@localhost]# snmpset -v 1 -c public localhost system.sysLocation.0 s "seoul"
이렇게 실행 시키고 확인해보니 원하는데로 잘 바뀌더군요...
그런데...제가 snmpwalk 명령으로 -RW- 모드로 되어 있는 ifAdminStatus를 set으로 변경하려 합니다..
참고로 요것은 아래와 같은 내용이더군요..

[root@localhost]# snmptranslate -On -Td -Ib 'ifAdminStatus'
.1.3.6.1.2.1.2.2.1.7
ifAdminStatus OBJECT-TYPE
  -- FROM       IF-MIB, RFC1213-MIB
  SYNTAX        INTEGER {up(1), down(2), testing(3)} 
  MAX-ACCESS    read-write
  STATUS        current
  DESCRIPTION   "The desired state of the interface.  The testing(3) state
            indicates that no operational packets can be passed.  When a
            managed system initializes, all interfaces start with
            ifAdminStatus in the down(2) state.  As a result of either
            explicit management action or per configuration information
            retained by the managed system, ifAdminStatus is then
            changed to either the up(1) or testing(3) states (or remains
            in the down(2) state)."
::= { iso(1) org(3) dod(6) internet(1) mgmt(2) mib-2(1) interfaces(2) ifTable(2) ifEntry(1) 7 }

그래서 위 sysLocation처럼 snmpset을 하려하는데...

첫째 질문) data type이 문제가 되더군요. String type은 s 'abc' 이런식으로 설정한다는 것은 알겠는데...integer type은 어찌되는지 모르겠습니다....비슷하게 해도 에러만 계속 남니다.

둘째 질문) 또다른 data type들을 보니 Integer32, EnumVal, Gauge, TimeTicks, Counter, etc..들이 있던데...이것들은 어찌 set을 해야하는지도 알고 싶습니다.

셋째 질문) 주위 분한테 들은 애기인데...snmp.conf 화일에서 COMMUNITY 값에 따라 snmpset을 할 수 있다고 하는데.

Quote:

# sec.name source community
com2sec local localhost public

위의 public -> private로 변경한 후 set을 해야 된다는 애기를 들었는데..맞는 말인지 궁금합니다.

너무 주저리 주저리 글을 올려 죄송합니다.

답변 부탁드립니다.

좋은 하루 되세요^.^

dude7853의 이미지

firehole wrote:
첫째 질문) data type이 문제가 되더군요. String type은 s 'abc' 이런식으로 설정한다는 것은 알겠는데...integer type은 어찌되는지 모르겠습니다....비슷하게 해도 에러만 계속 남니다.
둘째 질문) 또다른 data type들을 보니 Integer32, EnumVal, Gauge, TimeTicks, Counter, etc..들이 있던데...이것들은 어찌 set을 해야하는지도 알고 싶습니다.

일단 snmpset의 맨페이지를 참고하세요.
http://www.net-snmp.org/docs/man/snmpset.html

기본적인 방법은
ip.ipforwarding.0 i 2
이나
ip.ipforwarding.0 = 2
ip.ipForwarding.0 = INTEGER: not-forwarding(2)
이런 방식도 가능하다고 하는 군요

그리고 각 타입에 따라 i,u,s,x등을 바꾸시면 됩니다.
TIMETICKS의 경우라면 t 100000이런 식으로 하시면 되겠죠.

firehole의 이미지

답변 잘 읽었습니다.

좋은 하루 되세요..

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.