www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

SNMP and MRTG traffic statistics

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
fulvio
Site Admin


Joined: 01 Nov 2006
Posts: 1036

PostPosted: Sat Mar 14, 2009 6:27 pm    Post subject: SNMP and MRTG traffic statistics Reply with quote

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
View user's profile Send private message Send e-mail
cylent



Joined: 10 Mar 2009
Posts: 10

PostPosted: Sat Mar 14, 2009 9:03 pm    Post subject: more info pls? Reply with quote

ok so i install the package then how do we see the graphs? can you please give more detail?
Back to top
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Sun Mar 15, 2009 2:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
cylent



Joined: 10 Mar 2009
Posts: 10

PostPosted: Sun Mar 15, 2009 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
glippi



Joined: 20 Mar 2009
Posts: 2
Location: Groningen, Netherlands

PostPosted: Fri Mar 20, 2009 12:11 pm    Post subject: Reply with quote

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!?) Smile
What do you want me to do now? Smile
_________________
Remember, +90% of the human race suffers from a form of stupidity!
Back to top
View user's profile Send private message MSN Messenger
glippi



Joined: 20 Mar 2009
Posts: 2
Location: Groningen, Netherlands

PostPosted: Fri Mar 20, 2009 12:17 pm    Post subject: Reply with quote

I see i have a few more in different locations (quickly scrolling)

Advice please! Smile
_________________
Remember, +90% of the human race suffers from a form of stupidity!
Back to top
View user's profile Send private message MSN Messenger
redtdi



Joined: 21 Nov 2008
Posts: 22

PostPosted: Wed Apr 01, 2009 5:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
tamws



Joined: 18 Jul 2009
Posts: 7

PostPosted: Wed Jul 22, 2009 4:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
tekoholic



Joined: 11 Apr 2009
Posts: 4
Location: Northern Colorado, USA

PostPosted: Thu Jul 30, 2009 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
micampo



Joined: 24 Dec 2008
Posts: 60

PostPosted: Fri Aug 06, 2010 4:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
houkouonchi



Joined: 20 Mar 2010
Posts: 47

PostPosted: Sat Aug 07, 2010 9:44 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Findarato



Joined: 05 Nov 2010
Posts: 4

PostPosted: Fri Nov 05, 2010 6:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Mon Nov 08, 2010 1:24 pm    Post subject: Reply with quote

Can't you query locally or remotely? If it is the latter, check the firewall.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Findarato



Joined: 05 Nov 2010
Posts: 4

PostPosted: Mon Nov 08, 2010 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Tue Nov 09, 2010 7:46 am    Post subject: Reply with quote

Is it really running?
Code:
netstat -anp | grep 161

What does it show?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Findarato



Joined: 05 Nov 2010
Posts: 4

PostPosted: Tue Nov 09, 2010 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Findarato



Joined: 05 Nov 2010
Posts: 4

PostPosted: Tue Nov 09, 2010 3:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
F49G



Joined: 12 Jun 2012
Posts: 2

PostPosted: Tue Jun 12, 2012 3:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
aseques



Joined: 16 Jun 2009
Posts: 59

PostPosted: Thu Oct 04, 2012 1:22 pm    Post subject: Snmpd.conf simple config Reply with quote

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
View user's profile Send private message
matthew.a.squires



Joined: 03 Jul 2008
Posts: 99

PostPosted: Tue Oct 09, 2012 11:22 pm    Post subject: I am unable to complete the SNMP install Reply with quote

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
View user's profile Send private message Send e-mail
aseques



Joined: 16 Jun 2009
Posts: 59

PostPosted: Thu Oct 11, 2012 2:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
matthew.a.squires



Joined: 03 Jul 2008
Posts: 99

PostPosted: Fri Oct 12, 2012 8:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group