| View previous topic :: View next topic |
| Author |
Message |
fulvio Site Admin
Joined: 01 Nov 2006 Posts: 997
|
Posted: Sat Mar 14, 2009 6:27 pm Post subject: SNMP and MRTG traffic statistics |
|
|
The package http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz contains net-snmp binaries for Zeroshell. To install it use the following commands:
cd /Database
wget http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz
tar xvfz net-snmp-5.4.2.1-zs.tgz
This package could be included directly in the Zeroshell image, but before deciding to do that, I'd like to try using it to view graphic statistics about network traffic generated by MRTG.
Could anyone post a valid snmp configuration to make Zeroshell able to answer to MRTG queries?
Many thanks in advance.
Fulvio |
|
| Back to top |
|
 |
cylent
Joined: 10 Mar 2009 Posts: 10
|
Posted: Sat Mar 14, 2009 9:03 pm Post subject: more info pls? |
|
|
| ok so i install the package then how do we see the graphs? can you please give more detail? |
|
| Back to top |
|
 |
ppalias
Joined: 17 Dec 2008 Posts: 1151 Location: Athens, Greece
|
Posted: Sun Mar 15, 2009 2:27 pm Post subject: |
|
|
My snmpd.conf file from a Slackware 12.0 server, with mrtg working fine.
| Code: | root@sardela:~# cat /etc/snmp/snmpd.conf
###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the "system" mib group in the mibII tree.
# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string
syslocation "Agia Paraskevi"
# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string
syscontact "trendy <trendy>"
# sysservices: The proper value for the sysServices object.
# arguments: sysservices_number
sysservices 78
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.
# rouser: a SNMPv3 read-only user
# arguments: user [noauth|auth|priv] [restriction_oid]
rouser trendy noauth
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity trendy
# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
# arguments: community [default|hostname|network/bits] [oid]
#rwcommunity trendyrw localhost
###########################################################################
# SECTION: Trap Destinations
#
# Here we define who the agent will send traps to.
# trapcommunity: Default trap sink community to use
# arguments: community-string
trapcommunity public
###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
# The following check up on various aspects of a host.
# proc: Check for processes that should be running.
# proc NAME [MAX=0] [MIN=0]
#
# NAME: the name of the process to check for. It must match
# exactly (ie, http will not find httpd processes).
# MAX: the maximum number allowed to be running. Defaults to 0.
# MIN: the minimum number to be running. Defaults to 0.
#
# The results are reported in the prTable section of the UCD-SNMP-MIB tree
# Special Case: When the min and max numbers are both 0, it assumes
# you want a max of infinity and a min of 1.
proc sshd
proc icecast 1 1
proc ntpd 1 1
proc httpd
proc named 1 1
proc dhcpd 1 1
proc squid
# disk: Check for disk space usage of a partition.
# The agent can check the amount of available disk space, and make
# sure it is above a set limit.
#
# disk PATH [MIN=100000]
#
# PATH: mount path to the disk in question.
# MIN: Disks with space below this value will have the Mib's errorFlag set.
# Can be a raw byte value or a percentage followed by the %
# symbol. Default value = 100000.
#
# The results are reported in the dskTable section of the UCD-SNMP-MIB tree
disk / 100000000
disk /spare/storage1 100000000
disk /spare/storage2 100000000
disk /spare/storage3 100000000
disk /spare/storage4 100000000
disk /spare/storage5 100000000
disk /var/squid 10000000
disk /var/squid/cache1 10000000
disk /var/squid/cache2 10000000
disk /var/squid/cache3 10000000
# load: Check for unreasonable load average values.
# Watch the load average levels on the machine.
#
# load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
#
# 1MAX: If the 1 minute load average is above this limit at query
# time, the errorFlag will be set.
# 5MAX: Similar, but for 5 min average.
# 15MAX: Similar, but for 15 min average.
#
# The results are reported in the laTable section of the UCD-SNMP-MIB tree
load 75.0 65.0 50.0
###########################################################################
# SECTION: Extending the Agent
#
# You can extend the snmp agent to have it return information
# that you yourself define.
# pass: Run a command that intepretes the request for an entire tree.
# The pass program defined here will get called for all
# requests below a certain point in the mib tree. It is then
# responsible for returning the right data beyond that point.
#
# arguments: miboid program
#
# example: pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest
#
# See the snmpd.conf manual page for further information.
#
# Consider using "pass_persist" for a performance increase.
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat |
Of course many of these things are not necessary as they monitor disk space, processes active but in general having a contact name, system location, rouser and rocommunity should do the job. |
|
| Back to top |
|
 |
cylent
Joined: 10 Mar 2009 Posts: 10
|
Posted: Sun Mar 15, 2009 8:15 pm Post subject: |
|
|
Thats great but i dont see no start script in /etc/init.d or anything
how do i start the snmpd deamon?
also, where is the snmpd.conf file located in ZS? |
|
| Back to top |
|
 |
glippi
Joined: 20 Mar 2009 Posts: 2 Location: Groningen, Netherlands
|
Posted: Fri Mar 20, 2009 12:11 pm Post subject: |
|
|
I got the same thing.
I am running zeroshell img from harddrive and I would like to monitor user traffic per ip on the network.
I installed as described above, rebooted the server, but still have no access to any of the snmp features.
My conf is located in "/DB/_DB.003/opt/x.x/packages/sbin/snmpd"
| Code: |
root@palaimon net-snmp> cat snmpd.conf
#
# net-snmp (or ucd-snmp) persistent data file.
#
############################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
#
# **** DO NOT EDIT THIS FILE ****
#
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
############################################################################
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for snmpd in SNMPCONFPATH/snmpd.conf.
# Only "createUser" tokens should be placed here by snmpd administrators.
# (Did I mention: do not edit this file?)
#
usmUser * (purposely blanked)
setserialno * (purposely blanked)
##############################################################
#
# snmpNotifyFilterTable persistent data
#
##############################################################
##############################################################
#
# ifXTable persistent data
#
ifXTable .1 14:0 18:0x $
ifXTable .2 14:0 18:0x $
ifXTable .3 14:0 18:0x $
ifXTable .4 14:0 18:0x $
ifXTable .5 14:0 18:0x $
ifXTable .8 14:0 18:0x $
##############################################################
engineBoots 3
oldEngineID 0x80001f88805d29c229741bb849
|
So tell me..... since I am not a master in this (yet!?)
What do you want me to do now?  _________________ Remember, +90% of the human race suffers from a form of stupidity! |
|
| Back to top |
|
 |
glippi
Joined: 20 Mar 2009 Posts: 2 Location: Groningen, Netherlands
|
Posted: Fri Mar 20, 2009 12:17 pm Post subject: |
|
|
I see i have a few more in different locations (quickly scrolling)
Advice please!  _________________ Remember, +90% of the human race suffers from a form of stupidity! |
|
| Back to top |
|
 |
redtdi
Joined: 21 Nov 2008 Posts: 22
|
Posted: Wed Apr 01, 2009 5:34 pm Post subject: |
|
|
Hi Fulvio:
Have you been able to get SNMP to work with ZeroShell yet? I would love to use this feature once you have the bugs worked out.
Thanks,
Ken |
|
| Back to top |
|
 |
tamws
Joined: 18 Jul 2009 Posts: 7
|
Posted: Wed Jul 22, 2009 4:06 pm Post subject: |
|
|
For me, I follow these steps:
1. I use the config file example from ppalias, put it into /Database/opt/x.x/packages/share/snmp/snmpd.conf
2. and then add these lines to the "Post Boot" startup script:
# Start the SNMP Service
SNMPCONFPATH=/Database/opt/x.x/packages/share/snmp/
/Database/opt/x.x/packages/sbin/snmpd
It may not be a good method, but it works for me at this moment! The snmp service will auto run when the zeroshell start, and I can query the snmp values from a remote host. |
|
| Back to top |
|
 |
tekoholic
Joined: 11 Apr 2009 Posts: 4 Location: Northern Colorado, USA
|
Posted: Thu Jul 30, 2009 9:19 pm Post subject: |
|
|
OK, so how's about a Nagios Plugin Template? I'm no expert, and try as I might, I can't seem to figure out how to create... _________________ Intel P4 2.8G / 768M pc-2700 DDR / 20G hdd
Dual WAN / Single LAN / 1 NIC currently unused
Running ZeroShell 1.0.beta12 |
|
| Back to top |
|
 |
micampo
Joined: 24 Dec 2008 Posts: 58
|
Posted: Fri Aug 06, 2010 4:54 pm Post subject: |
|
|
alguein has pictures of the information that is gathered with snmp support?
to motivate me to mount it on the release 13 |
|
| Back to top |
|
 |
houkouonchi
Joined: 20 Mar 2010 Posts: 47
|
Posted: Sat Aug 07, 2010 9:44 am Post subject: |
|
|
The snmp.conf can be very simple, For example mine is just:
| Code: |
com2sec local 127.0.0.1/32 public
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local
view all included .1 80
access MyROGroup "" any noauth exact all none none
syslocation MyLocation
syscontact Me <me>
|
So its only accessible from localhost.
I have MRTG and SNMP working fine on my ZS box:
http://fios1.houkouonchi.jp/mrtg/
http://fios2.houkouonchi.jp/mrtg/ |
|
| Back to top |
|
 |
Findarato
Joined: 05 Nov 2010 Posts: 4
|
Posted: Fri Nov 05, 2010 6:19 pm Post subject: |
|
|
I am currently using the
| Quote: |
1. I use the config file example from ppalias, put it into /Database/opt/x.x/packages/share/snmp/snmpd.conf
2. and then add these lines to the "Post Boot" startup script:
# Start the SNMP Service
SNMPCONFPATH=/Database/opt/x.x/packages/share/snmp/
/Database/opt/x.x/packages/sbin/snmpd |
Except I used the config from houkouonchi.
I can see the script start, but I can not query it for any results. my config file is located /Database/opt/x.x/packages/share/snmp/snmpd.conf |
|
| Back to top |
|
 |
ppalias
Joined: 17 Dec 2008 Posts: 1151 Location: Athens, Greece
|
Posted: Mon Nov 08, 2010 1:24 pm Post subject: |
|
|
| Can't you query locally or remotely? If it is the latter, check the firewall. |
|
| Back to top |
|
 |
Findarato
Joined: 05 Nov 2010 Posts: 4
|
Posted: Mon Nov 08, 2010 3:04 pm Post subject: |
|
|
I can not poll it either.
I do not get any error messages in start up scripts so I am assuming its running. |
|
| Back to top |
|
 |
ppalias
Joined: 17 Dec 2008 Posts: 1151 Location: Athens, Greece
|
Posted: Tue Nov 09, 2010 7:46 am Post subject: |
|
|
Is it really running?
| Code: | | netstat -anp | grep 161 |
What does it show? |
|
| Back to top |
|
 |
Findarato
Joined: 05 Nov 2010 Posts: 4
|
Posted: Tue Nov 09, 2010 3:03 pm Post subject: |
|
|
udp 0 0 0.0.0.0:161 0.0.0 * 8069/snmp
when I snmpwalk -c public -v2c 127.0.0.1 I get
no more variables left in this mib view |
|
| Back to top |
|
 |
Findarato
Joined: 05 Nov 2010 Posts: 4
|
Posted: Tue Nov 09, 2010 3:21 pm Post subject: |
|
|
Here is exactly what is in my config file
com2sec local 127.0.0.1/32 public
com2sec netw 10.1.0.0/16 public
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local
group MyROGroup2 v1 netw
group MyROGroup2 v2c netw
group MyROGroup2 usm netwl
view all included .1 80
access MyROGroup "" any noauth exact all none none
access MyROGroup2 "" any noauth exact all none none
syslocation MyLocation
syscontact Me <me>
I added an entry to allow people on the 10.1.0.0 subnet to query the server, and one for the server itself.
I do not think its a firewall issue. |
|
| Back to top |
|
 |
F49G
Joined: 12 Jun 2012 Posts: 2
|
Posted: Tue Jun 12, 2012 3:14 pm Post subject: |
|
|
Hello Everyone,
I test ZS since few days and I would like to know if we could have QOS datas by SNMP ?
Or we need to activate it by licensing ?
Thanks,
François. |
|
| Back to top |
|
 |
aseques
Joined: 16 Jun 2009 Posts: 51
|
Posted: Thu Oct 04, 2012 1:22 pm Post subject: Snmpd.conf simple config |
|
|
Setting this in the snmpd.conf just works and it's simple (4 lines), secure (read only access), and private (can only be accessed from your remote server)
Install
| Code: | cd /Database
wget http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz
tar xvfz net-snmp-5.4.2.1-zs.tgz |
Config in /Database/opt/x.x/packages/share/snmp/snmpd.conf
| Code: | #Name of ro community and the authorized IP
rocommunity zscom 123.123.123.123
syslocation "Location"
syscontact mailbox@example.com
disk / 10% |
Remember that you will have to add the startup scripts that tamws posted in /Database/var/register/system/startup/rc.pre
| Code: | # Start the SNMP Service
SNMPCONFPATH=/Database/opt/x.x/packages/share/snmp/
/Database/opt/x.x/packages/sbin/snmpd |
Last edited by aseques on Thu Oct 11, 2012 2:05 pm; edited 1 time in total |
|
| Back to top |
|
 |
matthew.a.squires
Joined: 03 Jul 2008 Posts: 89
|
Posted: Tue Oct 09, 2012 11:22 pm Post subject: I am unable to complete the SNMP install |
|
|
What is the BA(Command)?
I have tried:
cd BA16
cd BARC1
cd BA2.0.RC1
cd RC1
cd 2.0.RC1
None of them work, so I cannot complete the install of the SNMP feature.
Please help....
Command Listed Below:
cd /Database
wget http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz
tar xvfz net-snmp-5.4.2.1-zs.tgz _________________ Thank You;
Matthew Squires |
|
| Back to top |
|
 |
aseques
Joined: 16 Jun 2009 Posts: 51
|
Posted: Thu Oct 11, 2012 2:03 pm Post subject: |
|
|
There's no BA commands in this case because the package is not totally integrated.
To enable it on startup the lines have to be added into /Database/var/register/system/startup/rc.pre |
|
| Back to top |
|
 |
matthew.a.squires
Joined: 03 Jul 2008 Posts: 89
|
Posted: Fri Oct 12, 2012 8:04 pm Post subject: |
|
|
Thank you for your responce, but I am still confused.
I am not a Linux Admin; I just play one on TV...
What is the command line that I would add?
Is the Start Command: /Database/var/register/system/startup/rc.pre
Or!
Am I putting the Start-Up command in the Script: /Database/var/register/system/startup/rc.pre
I have already created the Cron Job: "SNMP Service
SNMPCONFPATH", and I added the command: Database/opt/x.x/packages/share/snmp/
/Database/opt/x.x/packages/sbin/snmpd"
I am still unable to access the log using a SNMP Client on my Windows computer.
Is there something special I need to do or a special way to configure the SNMP Client that is installon on my Windows Box? _________________ Thank You;
Matthew Squires |
|
| Back to top |
|
 |
|