LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 07: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, 01:59 PM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
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, 03: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 03:24 AM. Reason: typo
 
  


Reply



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 check_snmp not found sp149 Linux - Server 10 01-04-2017 08:32 AM
nagios + snmp aeby Linux - Server 3 08-29-2009 11:15 PM
Nagios check_snmp plugin not found ataru Linux - Server 8 04-10-2009 02:18 PM
Nagios and SNMP Deaclen Linux - Software 1 02-28-2007 09:12 AM
Using SNMP in NAGIOS Bzw Linux - Networking 3 12-06-2004 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:34 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
Open Source Consulting | Domain Registration