Jump to content

Recommended Posts

Posted
Armbianmonitor:

Hi!

 

I'm trying to star the SNMP daemon, but i have :

 

pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.
pcilib: pci_init failed
Warning: no access control information configured.
  (Config search path: /etc/snmp:/usr/share/snmp:/usr/lib/arm-linux-gnueabihf/snmp:/home/pepeluis/.snmp)
  It's unlikely this agent can serve any useful purpose in this state.
  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for this agent.
Error opening specified endpoint ""
Server Exiting with code 1

 

I write in snmpd.conf

agentAddress udp:161

 

doesn't work,,,the same,,,

 

Any idea I will appreciate it a lot

 

Thanks!!!!

Posted

How did you install snmpd?

Are you running the config command with sudo?

are you starting the service with 
 

sudo systemctl start snmpd


 

Posted

Hi Lanefu!!!

 

install: 

sudo apt-get update && sudo apt-get install snmpd snmp-mibs-downloader

 

I execute your comand,,,,and get :

pepeluis@orangepizero:~$ service --status-all |grep snmp
 [ + ]  snmpd

 

it's running ok? There's  a way to test? because :

pepeluis@orangepizero:~$ snmpstatus localhost
snmpstatus: No securityName specified

 

and i don´t have any response

 

 

Posted

FWIW - here's a write up I did a couple of years back - useful for getting full use of snmp/snmpd...

 

===== SNMP =====

SNMP is a server/agent architecture - the agent runs on the target machines, and the service is run on the server - so we do both.

NOTE - this is optional - only needed if one wants to do cacti or other SNMP related apps - if you don't need this, you can skip it

NOTE 2 - we're covering SNMP v1/v2 - SNMP v3 includes some auth options that are handy to have, but generally in a local area network, they're 'extra credit' as many clients do not support it, and we're keeping things simple in this series.

Good overview here - https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol

The config files

  * **snmpd.conf** - configures the agent and servers
  * **snmp.conf** - configures the server only

**Install SNMP**

  sudo apt install snmp 

go to /etc/snmp and comment out the following line like this - this allows you to import MIB's

  sudo nano /etc/snmp/snmp.conf 

  # As the snmp packages come without MIB files due to license reasons, loading
  # of MIBs is disabled by default. If you added the MIBs you can reenable
  # loading them by commenting out the following line.
  mibs :

comment out the mibs line like below

  #mibs :

Now run the mibs-downloader

  sudo apt install snmp-mibs-downloader

done for server-side - smpd is optional for the server, but if you want to collect stats on localhost you'll need a configured SNMP Agent

**SNMP Agent**

To install the agent on a debian/ubuntu based machine

  sudo apt install snmpd

For other platforms, check their documentation - Windows does support SNMP, but it needs to be turned on, same with Macs, QNAP/Synology NAS boxes are good, HP OfficeJet tends to have it enabled with 'public' community (not all do), some consumer routers also have SNMP agents (AsusWRT-RMerlin, as least in the builds I checked in his github). Many managed switches (smart switches) also have SNMP agents

On linux - The agent config as shipped is very thorough, however, we can make it really simple...

  sudo mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig

Now create a new one 

  sudo nano /etc/snmp/snmpd.conf

Only one line needs to be there, but you can add a couple of informative ones as needed - what we're doing here on the agent side is create a read-only SNMP community, naming it "public" and limiting scope to the local area network (in CIDR notation)

  rocommunity  public 192.168.1.0/24
  # syslocation  "testLab"
  # syscontact  gmailuser@gmail.com

One more file to change - comment out the export MIBS line and save

  sudo nano /etc/default/snmpd

<code>
  # This file controls the activity of snmpd
  
  # Don't load any MIBs by default.
  # You might comment this lines once you have the MIBs downloaded.
  # export MIBS=
  
  # snmpd control (yes means start daemon).
  SNMPDRUN=yes
  
  # snmpd options (use syslog, close stdin/out/err).
  SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid'
</code>

save the file and start/restart snmpd

  sudo service snmpd restart

to test, do an snmpwalk against the local ip

  sudo snmpwalk -c public -v1 192.168.1.6

You should get a lot of information back, or the connection will timeout (e.g. either wrong community, or the agent isn't running/answering up)

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines