5

I am trying to configure SNMP on Ubuntu 14.04. There is a step where I have to edit the community string along with sysLocation and sysContact but I am not sure what goes there. What are the sysLocation and sysContact objects in the snmpd.conf file and how I can get those values for my machine?

Kevin Bowen
  • 1,625
  • 2
  • 23
  • 27
Swapnil1988
  • 269
  • 3
  • 6
  • 18
  • I know the question has already been answered, but I'd still argue that this is off-topic for Stack Overflow because it concerns system administration, not programming. The question and answers should be migrated to serverfault.com. – Jolta Dec 08 '14 at 10:34
  • Don't worry, the mods will take care of it if they think I'm right... – Jolta Dec 08 '14 at 13:58
  • @Jolta I agree that the poster doesn't make it clear that this is for programming purposes. SNMP related answers are useful for anyone writing software that monitors SNMP or software for devices that present SNMP data (which is why I've searched the snmp tag on Stack Overflow in the past) – Matt Coubrough Dec 08 '14 at 21:07
  • I know it question i asked is in abstract manner ....and thanks to you guys for commenting over this .i am a java developer and implementing snmp services with java all i was trying to do was to configure snmp service on my ubuntu virtual machine and i have no idea about what should go in that snmpd.config file ....thanks for your comments next time i will keep that in mind while posting,. – Swapnil1988 Dec 09 '14 at 07:31

3 Answers3

4

All SNMP devices share the following common configurable parameters:

  • sysLocation
  • sysContact
  • sysName
  • Read-write and read-only access community strings (and frequently, a trap community string)
  • Trap destination

sysLocation is the physical location for the device being monitored. Its definition in RFC 1213 is:

sysLocation OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..255))
    ACCESS  read-write
    STATUS  mandatory
    DESCRIPTION
        "The physical location of this node (e.g., 'telephone closet,
         3rd floor')."
    ::= { system 6 }

RFC 1213's definition of sysContact is similar to that of sysLocation:

sysContact OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..255))
    ACCESS  read-write
    STATUS  mandatory
    DESCRIPTION
        "The textual identification of the contact person for this managed
         node, together with information on how to contact this person."
    ::= { system 4 }

sysContact is a DisplayString. It's fairly obvious what it's used for: it identifies the primary contact for the device in question. It is important to set this object with an appropriate value, as it can help your operations staff determine who needs to be contacted in the event of some catastrophic failure. You can also use it to make sure you're notified, if you're responsible for a given device, when someone needs to take your device down for maintenance or repairs. As with sysLocation, make sure to keep this information up to date as your staff changes. It's not uncommon to find devices for which the sysContact is someone who left the company several years ago.

source: http://docstore.mik.ua/orelly/networking_2ndEd/snmp/ch07_01.htm

shivam
  • 16,048
  • 3
  • 56
  • 71
3

SysLocation and SysContact are simply arbitrary SNMP string variables that are part of SNMPV2-MIB and can be fetched with SNMP get.

OID 1.3.6.1.2.1.1.4 == SysContact
OID 1.3.6.1.2.1.1.6 == SysLocation

Most sites I have been involved with use SysLocation as a decription of the location of the SNMP managed network device, and SysContact as the contact details of somebody who is in some way responsible for the device.

Warning: SysContact also has a habit of becoming out of date without being modified when staff changes.

To get sysContact using snmpget command line:

snmpget -v1 -c public localhost system.sysContact.0

where "public" is your community string, and "localhost" is the ip address of the machine you want to send the SNMP query to.

Matt Coubrough
  • 3,739
  • 2
  • 26
  • 40
1

These values are defined by the administrator. Common formats include:

syslocation Rack, Room, Building, City, Country [GPSX,Y]
syscontact Your Name <your@email.address>

If all the equipment you monitor is in the same country you can use the format google maps uses: "street, city, state zip". For example searching google maps for the white house returns:

1600 Pennsylvania Ave NW, Washington, DC 20500

syslocation is often used my monitoring applications to generate visual maps.

Jason Ellison
  • 41
  • 1
  • 3