LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-29-2009, 08:39 AM   #1
umarzuki
Member
 
Registered: Aug 2008
Distribution: Debian
Posts: 61

Rep: Reputation: 15
using nagios check_snmp plugin to get snmp info from computer


by manually run
# ./check_snmp -H 192.168.56.2 -C public -P 1 -o HOST-RESOURCES-MIB::hrDiskStorageCapacity.6

i can get snmp data, but how to define that check as check_command in a computer/host config file?
 
Old 08-29-2009, 02:59 PM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,240

Rep: Reputation: 132Reputation: 132
I don't know the purpose why you are checking whole disk capacity(is there disk array?) because usually we are checking disk usage, however refer the following site
http://nagios.manubulon.com/index_co...html#interface
 
Old 09-08-2009, 04:12 AM   #3
umarzuki
Member
 
Registered: Aug 2008
Distribution: Debian
Posts: 61

Original Poster
Rep: Reputation: 15
Smile

Finally, I found a way to get snmp info from a host
  1. Run snmpwalk to view OID name
    Code:
    snmpwalk -v 1 -c public 192.168.56.1
    Note that public is the community string and 1 is the SNMP version
  2. Pick one, ie: SNMPv2-MIB::sysContact.0 (sysadmin mail address)
  3. Use snmptranslate to get OID number
    Code:
    snmptranslate -On SNMPv2-MIB::sysContact.0
  4. Check the OID number with check_snmp manually
    Code:
    ./check_snmp -H 192.168.56.1 -C public -o .1.3.6.1.2.1.1.4.0
  5. Take note of check_snmp options and arguments, then define/edit a command
    Code:
    define command{
            command_name    check_snmp
            command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$
            }
    Note that $HOSTADDRESS$ is a macro so no need to fill that out since it will refer to current host config
  6. Define a service for that
    Code:
    define service{
            use                             other-service
            host_name                       laptop
            service_description             Admin email
            check_command                   check_snmp!.1.3.6.1.2.1.1.4.0
            }
    Since the first and second argument already filled out in command definition, we just need to add the last argument which is the OID number with exclamation mark (!) before it. Of course, other-service template is already defined.

Last edited by umarzuki; 09-08-2009 at 04:24 AM. Reason: typo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
nagios + snmp aeby Linux - Server 3 08-30-2009 12:15 AM
nagios check_snmp not found sp149 Linux - Server 8 06-11-2009 10:50 PM
Nagios check_snmp plugin not found ataru Linux - Server 8 04-10-2009 03:18 PM
Nagios and SNMP Deaclen Linux - Software 1 02-28-2007 10:12 AM
Using SNMP in NAGIOS Bzw Linux - Networking 3 12-06-2004 08:13 AM


All times are GMT -5. The time now is 10:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration