From owner-freebsd-doc@FreeBSD.ORG Mon Apr 4 22:00:25 2011 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3BD1065673 for ; Mon, 4 Apr 2011 22:00:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 08EE38FC14 for ; Mon, 4 Apr 2011 22:00:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p34M0Mrw022203 for ; Mon, 4 Apr 2011 22:00:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p34M0Mel022202; Mon, 4 Apr 2011 22:00:22 GMT (envelope-from gnats) Resent-Date: Mon, 4 Apr 2011 22:00:22 GMT Resent-Message-Id: <201104042200.p34M0Mel022202@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Meyer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED20F106564A for ; Mon, 4 Apr 2011 21:56:46 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id DB9D08FC17 for ; Mon, 4 Apr 2011 21:56:46 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p34LukTu003941 for ; Mon, 4 Apr 2011 21:56:46 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p34LukIJ003940; Mon, 4 Apr 2011 21:56:46 GMT (envelope-from nobody) Message-Id: <201104042156.p34LukIJ003940@red.freebsd.org> Date: Mon, 4 Apr 2011 21:56:46 GMT From: Mark Meyer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: docs/156187: Add bsnmpd to handbook X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2011 22:00:25 -0000 >Number: 156187 >Category: docs >Synopsis: Add bsnmpd to handbook >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Apr 04 22:00:22 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Mark Meyer >Release: FreeBSD 8.2-RELEASE i386 >Organization: n/a >Environment: System: FreeBSD nv-fbsd 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: The documentation TODO contains an item on the bsnmpd daemon. This fix contains a change to the handbook to add a section to the network-daemons chapter. Please comment on its suitability. >How-To-Repeat: Look up the handbook. >Fix: Apply the following patch to the handbook. Patch attached with submission follows: ? bsnmpd.diff Index: network-servers/chapter.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml,v retrieving revision 1.129 diff -u -r1.129 chapter.sgml --- network-servers/chapter.sgml 4 Apr 2011 05:23:33 -0000 1.129 +++ network-servers/chapter.sgml 4 Apr 2011 21:40:56 -0000 @@ -5383,6 +5383,125 @@ by local users. + + + + + + Mark + Meyer + Contributed by + + + + + Updated by + The &os; Documentation Project + + + + + The <application>bsnmpd</application> Server + + + Overview + + With your first installation of FreeBSD, bsnmpd is + provided as the default software implementing SNMPv2. For the + purpose of testing we will assume you're trying to connect to + this service from your local system. + + NTo run the tests in this section you will additionally + need net-mgmt/bsnmptools, + which you can install via the bsnmptools package or + port. + + + + + Configuring <application>bsnmpd</application> + + The bsnmpd configuration resides in /etc/bsnmpd.config and + is already in a runnable state. By default bsnmpd allows + anybody to read any variable using the community "public". If + you don't want everybody to read your SNMP variables, choose a + different read community and edit the configuration setting + accordingly: + + read := "superprivate" + + Choose the community string wisely. Everybody able to + guess it, will be able to read from your systems management + data. The community will however be transferred in plain text + over the wire, thus potentially leaking an otherwise secure + password to an attacker. + + The variables "location" and "contact" can be set. They + are intended to reflect the physical location and system + administration contact respectively: + + location := "Room 200" +contact := "sysmeister@example.com" + + If you want to send SNMP traps to a specific port, set + both "traphost" and "trapport" variables: + + traphost := monitor.example.com +trapport := 162 + + + + + Running <application>bsnmpd</application> + + To run bsnmpd at system startup, add the following to your + /etc/rc.conf: + + bsnmpd_enabl="YES" + + Doing a + + &prompt.root; /etc/rc.d/bsnmpd start + + will start bsnmpd + immediately. To test your setup, run + an bsnmpget from the machine you + installed on. + + &prompt.root; /usr/local/bin/bsnmpget -s superprivate@localhost sysContact +sysContact.0 = sysmeister@example.com + + The command should dump the value you entered in your + configuration. + + + + + Loading a module + + Most of the bsnmpd functionality is available via + modules. For demonstration purposes we will load the host + resources module, which we will query for how much ram this + system has. In snmpd.config the mib-2 module is + already activated. We will add the host resources + module. Search for the following line and uncomment it, by + removing the hash sign in front: + + begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" + + Now restart bsnmpd: + + &prompt.root; /etc/rc.d/bsnmpd restart + + Now you are able to query the amount of RAM (in kilobytes) + this system has: + + &prompt.root; /usr/local/bin/bsnmpwalk -s superprivate@localhost -n 1.3.6.1.2.1.25.2.2 +1.3.6.1.2.1.25.2.2 = 511392 + + + +