Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNMP with integrated configuration #4994

Open
guidov22 opened this issue Sep 17, 2019 · 10 comments
Open

SNMP with integrated configuration #4994

guidov22 opened this issue Sep 17, 2019 · 10 comments
Labels
triage Needs further investigation

Comments

@guidov22
Copy link

Hello,
agentx is not working.

FRR version is:
FRRouting 7.1 (frr-test-a).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
'--enable-systemd' '--enable-sharpd' '--enable-snmp' '--enable-multipath=8' '--enable-config-rollbacks' '--enable-exampledir=/usr/share/doc/frr/examples/' '--localstatedir=/var/opt/frr' '--sbindir=/usr/lib/frr' '--sysconfdir=/etc/frr' '--enable-multipath=64' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' '--enable-fpm' '--with-moduledir=/usr/lib/frr/modules'

We are using integrated configuration.

The command is suggested by configuration:
frr-test-a(config)# a?
access-list Add an access list entry
agentx SNMP AgentX protocol settings
allow-external-route-update Allow FRR routes to be overwritten by external processes

but not recognised by zebra:

frr-test-a# conf t
frr-test-a(config)# agentx
% [ZEBRA] Unknown command: agentx
frr-test-a(config)#

Thanks and regards

@guidov22 guidov22 added the triage Needs further investigation label Sep 17, 2019
@donaldsharp
Copy link
Member

can you show us the contents of our /etc/frr/daemons file?

@guidov22
Copy link
Author

guidov22 commented Sep 17, 2019 via email

@donaldsharp
Copy link
Member

Add -M snmp to your daemon_options line for the daemons you want snmp working on.

@guidov22
Copy link
Author

guidov22 commented Sep 17, 2019 via email

@guidov22
Copy link
Author

guidov22 commented Sep 17, 2019 via email

@yswery-reconz
Copy link

I am having the same issue where I can find this returning at all via SNMP. I have FRR with snmp support installed (Pfsesne 2.5)

[2.5.0-RELEASE][[email protected]]/root: ps aux | grep frr
frr     17902   0.0  0.6  72184 25492  -  Ss   11:55     0:00.03 /usr/local/sbin/zebra -M snmp -d
frr     38591   0.0  0.2  20348  7256  -  Ss   11:46     0:00.06 /usr/local/sbin/staticd -d
frr     39927   0.0  0.6  53560 26736  -  Ss   11:46     0:00.11 /usr/local/sbin/bgpd -M snmp -d
Module information for bgpd:
Module Name  Version                   Description

libfrr       7.5                       libfrr core module
bgpd         7.5                       bgpd daemon
bgpd_snmp    7.5                       bgpd AgentX SNMP module
	from: /usr/local/lib/frr/modules/bgpd_snmp.so
pid: 19886

On the snmpd i also have agentx of course, but snmp walk doesnt show anything BGP related.

Does anyone know what I could try to do?

@sabik
Copy link

sabik commented Jul 2, 2021

Per https://redmine.pfsense.org/issues/11610 it looks like the "Unknown command: agentx" error occurs when agentxperms in the SNMP config are too restrictive; if that's the case, it looks like a misleading error message - it should give some variant of "permission denied" or "could not contact AgentX", not "unknown command".

(It would also mean that SNMP must be configured before FRR, which is an odd requirement; it should probably be either relaxed or at least documented.)

@manomugdha
Copy link

Hello, done … it seems to work now … but doing r00t@frr-test-a:$ snmpwalk -c %nast1a%0 -v2c localhost .1.3.6.1.2.1.14.1.1 iso.3.6.1.2.1.14.1.1 = No Such Object available on this agent at this OID r00t@frr-test-a:$ is there a mib tree ? I cannot find it … I only find ospf tree on example to enable snmp thanks and regards

Il giorno 17 set 2019, alle ore 14:59, Donald Sharp @.***> ha scritto: Add -M snmp to your daemon_options line for the daemons you want snmp working on. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#4994?email_source=notifications&email_token=AC42QGF74LDFBV4SGPEGLA3QKDIETA5CNFSM4IXPLWS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD64N6SQ#issuecomment-532209482>, or mute the thread https://github.com/notifications/unsubscribe-auth/AC42QGGATDWNVZFFXPIBKADQKDIETANCNFSM4IXPLWSQ.

Hi @guidov22 ,
I am facing issue to connect to snmpd from frr-snmp-agent. frr can recognize agentx but it can not connecto snmpd. it throws following warning:

2024/01/02 13:34:29 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:34:44 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:34:59 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:35:14 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:35:29 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:35:44 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:35:59 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):
2024/01/02 13:36:14 BGP: [RZ3YY-GPH41][EC 100663310] snmp[warning]: Warning: Failed to connect to the agentx master agent ([NIL]):

I ran snmpd in foreground and following is the output:

frr@frr_1:/$ sudo /usr/sbin/snmpd -f -L -Dagentx
registered debug token agentx, 1
agentx_register_app_config_handler: registering .conf token for "agentxsocket"
agentx_register_app_config_handler: registering .conf token for "agentxperms"
agentx_register_app_config_handler: registering .conf token for "agentxRetries"
agentx_register_app_config_handler: registering .conf token for "agentxTimeout"
Turning on AgentX master support.
agentx/master: initializing...
agentx/master: initializing...   DONE
NET-SNMP version 5.8

I have doubt about the /etc/snmp/snmpd.conf file. following is my snmpd.conf file.

sysLocation    Sitting on the Dock of the Bay
sysContact     Me <[email protected]>
sysServices    72

master  agentx
agentaddress  127.0.0.1,[::1]

view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1

rocommunity  public default -V systemonly
rocommunity6 public default -V systemonly
rouser authPrivUser authpriv -V systemonly

i see udp is listening on the correct port:

frr@frr_1:/$ netstat -anu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
udp        0      0 127.0.0.1:161           0.0.0.0:*
udp        0      0 127.0.0.11:38421        0.0.0.0:*
udp6       0      0 ::1:161                 :::*
frr@frr_1:/$

can you please share the content of your working snmpd.conf file?

@zappiehost
Copy link

@manomugdha this is what we added for the correct agentx permissions a few years back and left it as is since:

master agentx
agentxperms 777 777

That being said though, right now it seems that FRR is broken on FreeBSD with the way SNMP is implemented, see some of the latest tickets about this here:

#14875

It might be your issue isnt an agentx thing but more of a general FRR + snmp thing. To test this easiest way I can see will be to try to run run frr with -M snmp like so: $ bgpd -M snmp

If you find anything useful or a nice solution for the above do post your findings here or in the other linked ticket

@manomugdha
Copy link

I updated snmpd.conf to the following and everything is working for me till now. I can trigger snmpwalk from different host as well.

frr@frr_1:/$ sudo cat /etc/snmp/snmpd.conf
sysServices    72
master  agentx
agentaddress  0.0.0.0,[::1]
agentxperms 777 777

rocommunity  public default
frr@frr_1:/$
e.g.
root@host_1:/# snmpwalk -c public -v2c -On -Ln 1.1.1.2 1.3.6.1.2.1.31.1.1.1.1.1
.1.3.6.1.2.1.31.1.1.1.1.1 = STRING: "lo"
root@host_1:/# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

6 participants