Monitoring of BGP session via Quagga daemon in Linux

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

Data Queries [rn - Quagga - Get BGP Neighbors Information]
Data Queries [rn - Quagga - Get BGP Neighbors Information]
bgp_nei_v1.0.png (113.27 KiB) Viewed 21976 times
Data Queries [rn - Quagga - Get BGP Router Information]
Data Queries [rn - Quagga - Get BGP Router Information]
bgp_router_info_v1.0.png (46.62 KiB) Viewed 21976 times
=======================================================================
DESCRIPTION


* snmp_quagga_bgpd_mon.pl
* v1.0a (2014.02.22)
* by red_neon (red_neon [at] dcpp [dot] ru)
* Monitoring BGP session via Quagga daemon in Linux.
=======================================================================
CHANGES


Monitoring BGP session via Quagga daemon in Linux v1.0a - 2014.02.22:

1. fixed: incorrect reading the string in command "show ip bgp summary" when the peer with State/PfxRcd: Idle (Admin)


How to update previous version 1.0:

1. Replace old snmp_quagga_bgpd_mon.pl on new
2. Restart snmpd
=======================================================================
INSTALLATION


[REMOTE-SERVER SIDE]

[1] Quagga installed and "vtysh" properly configured using the nopassword directive.

[2] Copy quagga_bgpd_mon_v1.0a/remote_server/snmp_quagga_bgpd.pl to the remote server (for example /etc/srv_scripts/snmp_quagga_bgpd_mon.pl)
Then check path to "vtysh" in the script settings:
my $_vtysh = "/usr/bin/vtysh";

[3a] If SNMPD is running NOT from root user. And you don't want give access user "snmp" to "vtysh". You need to put into Cron next task:
$ nano /etc/crontab
*/5 * * * * root /bin/sleep 290; /usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl cron 2>&1

Script will check Quagga via "vtysh" every 5 mins, then it will get data and save them into temp files in /tmp/ directory.
You can change directory and names of temp files in script-settings below (my $_file_.... )
To create temp files at first time, run the script in command line with parameter "cron":

$ /usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl cron

Ok. Go to pat.4)

[3b] If SNMPD is running from root user or snmp user have access to "vtysh". You need to change value of $_ROOT in this script below:
my $_ROOT = 1;

[4] Put into snmpd.conf string with pass_persist:
$ nano /etc/snmp/snmpd.conf
pass_persist .1.3.6.1.4.1.2021.190.1000.3 /usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl

[5] Restart snmpd:
$ /etc/init.d/snmpd restart


!!! WARNING !!! If your linux are used SELinux (like CentOS), you must disable policy for snmp (or create a new policy yourself)
For disable snmp-module in SELinux:
$ semodule -d snmp
$ systemctl restart snmpd


[6] Test via snmpwalk:
$ snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.2021.190.1000.3
iso.3.6.1.4.1.2021.190.1000.3.1.0 = INTEGER: 1
iso.3.6.1.4.1.2021.190.1000.3.1.0.1 = INTEGER: 1
iso.3.6.1.4.1.2021.190.1000.3.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.2021.190.1000.3.1.2.1 = STRING: "0.99.20.1"
iso.3.6.1.4.1.2021.190.1000.3.1.3.1 = STRING: "192.168.1.100"
iso.3.6.1.4.1.2021.190.1000.3.1.4.1 = STRING: "65000"
iso.3.6.1.4.1.2021.190.1000.3.1.5.1 = INTEGER: 17
iso.3.6.1.4.1.2021.190.1000.3.1.6.1 = INTEGER: 16
iso.3.6.1.4.1.2021.190.1000.3.1.7.1 = Gauge32: 5787558
iso.3.6.1.4.1.2021.190.1000.3.1.8.1 = Gauge32: 475307
iso.3.6.1.4.1.2021.190.1000.3.1.9.1 = Gauge32: 872419
iso.3.6.1.4.1.2021.190.1000.3.1.10.1 = Gauge32: 185567
iso.3.6.1.4.1.2021.190.1000.3.1.11.1 = Gauge32: 11023
iso.3.6.1.4.1.2021.190.1000.3.2.0 = INTEGER: 1
iso.3.6.1.4.1.2021.190.1000.3.2.1.1 = INTEGER: 1
iso.3.6.1.4.1.2021.190.1000.3.2.2.1 = INTEGER: 4
iso.3.6.1.4.1.2021.190.1000.3.2.3.1 = STRING: "[4] Neighbors"
...


[CACTI-SERVER SIDE]

[7] Copy snmp_quagga_bgpd_neighbors_queries.xml and snmp_quagga_bgpd_router_queries.xml
from quagga_bgpd_mon_v1.0a/cacti_dir/resource/snmp_queries/
to: cacti/resource/snmp_queries/

[8] Import templates from quagga_bgpd_mon_v1.0a/cacti_web_templates/ in Cacti.
=======================================================================

When you will create graphs - look at type of graph (see screenshots)

red_neon
graph_select_1_v1.0.png
graph_select_1_v1.0.png (27.07 KiB) Viewed 21976 times
graph_select_2_v1.0.png
graph_select_2_v1.0.png (28.91 KiB) Viewed 21976 times
quagga_bgpd_mon_v1.0a.zip
(227.94 KiB) Downloaded 936 times
Last edited by red_neon on Thu Feb 11, 2016 11:05 pm, edited 2 times in total.
"Imagination is more important than Knowledge."
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by mojiro »

omg! great job!
[i]Born to be online![/i]
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by mojiro »

Can you please explain me the meaning of the pulse ?
[i]Born to be online![/i]
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

mojiro wrote:Can you please explain me the meaning of the pulse ?
A curve, if there are changes in the value of MsgSent+MsgRcvd. (if there is activity in the send \ receiving route updates)
It does not display the intensity of the updates. It shows that were only changes.
"Imagination is more important than Knowledge."
User avatar
PSI
Posts: 4
Joined: Sun Jul 17, 2011 9:02 am

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by PSI »

There is a bug in the solution. When the first neighbor is in the Idle (Admin) state, you won't get any neighbor stats ( UCD-SNMP-MIB::ucdavis.190.1000.3.2.0 = INTEGER: 0 )
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

PSI wrote:There is a bug in the solution. When the first neighbor is in the Idle (Admin) state, you won't get any neighbor stats ( UCD-SNMP-MIB::ucdavis.190.1000.3.2.0 = INTEGER: 0 )
Thanks! Corrected.
"Imagination is more important than Knowledge."
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

First post has been updated!

CHANGES


Monitoring BGP session via Quagga daemon in Linux v1.0a - 2014.02.22:
1. fixed: incorrect reading the string in command "show ip bgp summary" when the peer with State/PfxRcd: Idle (Admin)


How to update previous version 1.0:
1. Replace old snmp_quagga_bgpd_mon.pl on new
2. Restart snmpd
"Imagination is more important than Knowledge."
gslavic
Posts: 8
Joined: Tue Feb 09, 2016 5:07 am

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by gslavic »

I am experiencing problems with this script.
I am running it on CentOS 7 and have encountered several problems with execution.
1. When I execute the script with>
/usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl cron
The files get updated with data that seems OK

2. Unfortunately on the machine that has activated there is a message SELinux:
Feb 9 10:33:11 XXXX python: SELinux is preventing /usr/local/bin/vtysh from connectto access on the unix_stream_socket .

***** Plugin catchall (100. confidence) suggests **************************

If you believe that vtysh should be allowed connectto access on the unix_stream_socket by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep vtysh /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


3. Also on both mashines that are running the script - when I do the "walk" there is no useful data:
[root@XXXXX ~]# snmpwalk -v 1 172.XX.XX.XX -c XXX .1.3.6.1.4.1.2021.190.1000.3
UCD-SNMP-MIB::ucdavis.190.1000.3.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.190.1000.3.1.0.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.190.1000.3.1.1.1 = INTEGER: 2
UCD-SNMP-MIB::ucdavis.190.1000.3.1.2.1 = STRING: "unknown"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.3.1 = STRING: "n/a"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.4.1 = STRING: "n/a"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.5.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.6.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.7.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.8.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.9.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.10.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.11.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.2.0 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.3.0 = INTEGER: 0


Where is the problem in execution of this script ?
How can it be fixed ?
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by phalek »

Did you try executing this:

Code: Select all

grep vtysh /var/log/audit/audit.log | audit2allow -M mypol
semodule -i mypol.pp 
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
gslavic
Posts: 8
Joined: Tue Feb 09, 2016 5:07 am

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by gslavic »

phalek wrote:Did you try executing this:

Code: Select all

grep vtysh /var/log/audit/audit.log | audit2allow -M mypol
semodule -i mypol.pp 
Yes. Unfortunately that didn't bring any progress to the situation. The part with SELinux can be "worked around" (even by disabling the SELinux as the last resort).
The bigger problem is inability of the script to send appropriate data to SNMP query (that problem exists even on the machine that does have Centos installed and SELinux disabled !!!).

What is even more problematic is the fact that scripts work just fine on Ubuntu machine !

Is there something in CentOS (that I overlooked) that could prevent normal execution of simple perl script ?!?!?

The script runs normally when it is executed by root or even non root users ("PING-PONG test") !
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

gslavic, show:

Code: Select all

ls -alh /tmp/snmp_quagga_bgpd*
and

Code: Select all

cat /tmp/snmp_quagga_bgpd_ipsum
and

Code: Select all

vtysh -c "show ip bgp summary"
"Imagination is more important than Knowledge."
gslavic
Posts: 8
Joined: Tue Feb 09, 2016 5:07 am

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by gslavic »

red_neon wrote:gslavic, show:

Code: Select all

ls -alh /tmp/snmp_quagga_bgpd*
and

Code: Select all

cat /tmp/snmp_quagga_bgpd_ipsum
and

Code: Select all

vtysh -c "show ip bgp summary"

Code: Select all

[root@rtr-palata ~]# vtysh -c "show ip bgp summary"
BGP router identifier xxx.xxx.xxx.XX.7, local AS number 13004
RIB entries 535176, using 57 MiB of memory
Peers 85, using 379 KiB of memory
RS-Client peers 80, using 357 KiB of memory
Peer groups 2, using 64 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
xxx.xxx.xxx.1    4  1200  142830  127182        0    0    0 6d22h11m        4
xxx.xxx.xxx.168  4 20940  127828  127476        0    0    0 6d22h11m       25
xxx.xxx.xxx.178  4 33873  126485  127273        0    0    0 6d22h11m       10
xxx.xxx.xxx.183  4 16298  144419  128426        0    0    0 17:14:04        1
xxx.xxx.xxx.192  4  1836  131623  127332        0    0    0 4d20h23m       79
xxx.xxx.xxx.216  4 21478  181030  127268        0    0    0 6d22h09m        1
xxx.xxx.xxx.242  4  2484  260725  253609        0    0    0 4d20h22m        1
xxx.xxx.xxx.255  4  6777 27483994  130564        0    0    0 4d20h22m   100422
xxx.xxx.xxx.0    4  6777 27613675  130889        0    0    0 4d20h22m    99397
xxx.xxx.xxx.1    4  1200  142850  127176        0    0    0 6d22h11m        4
xxx.xxx.xxx.34   4 13285  258380  253514        0    0    0 20:40:15      137
xxx.xxx.xxx.110  4 10310  257692  253186        0    0    0 4d20h23m      159
xxx.xxx.xxx.148  4 49685  126980  127254        0    0    0 4d20h23m      115
xxx.xxx.xxx.155  4 25151       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.163  4 10310  257927  253112        0    0    0 4d20h22m      159
xxx.xxx.xxx.208  4 20940  261524  253652        0    0    0 4d20h23m       29
xxx.xxx.xxx.217  4  8365  139438  127295        0    0    0 6d22h11m       45
xxx.xxx.xxx.221  4 41692       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.58   4 42473  129353  127398        0    0    0 4d20h23m       81
xxx.xxx.xxx.144  4 51852       0       0        0    0    0 never    Connect
xxx.xxx.xxx.160  4   714  255798  253267        0    0    0 4d20h23m       20
xxx.xxx.xxx.177  4 41913  142992  127275        0    0    0 6d22h11m       20
xxx.xxx.xxx.183  4   714  255346  252887        0    0    0 4d20h23m       20
xxx.xxx.xxx.x1   4 51852  129723  118486        0    0    0 4d20h23m       15
xxx.xxx.xxx.1    4 59899  149602  137976        0    0    0 01w1d01h     2584
xxx.xxx.xxx.100  4 59899  134941  130862        0    0    0 6d08h08m     2509
xxx.xxx.xxx.8      4 13005       2     833        0    0    0 12w4d07h Idle (Admin)
xxx.xxx.xxx.28     4 13006       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.XX1      4 59900  268285  148721        0    0    0 01w1d01h     2599
xxx.xxx.xxx.XX254    4 59900  268858  148808        0    0    0 01w1d01h     2598
xxx.xxx.xxx.XX.1   4 13004  157540 1583816        0    0    0 01w1d12h     2508
xxx.xxx.xxx.XX.5   4 13004  152894 1556883        0    0    0 02w5d15h     2507
xxx.xxx.xxx.XX1     4  1853  190383  130735        0    0    0 02w6d23h      281
xxx.xxx.xxx.XX2     4  1853  190357  130751        0    0    0 02w6d23h      281
xxx.xxx.xxx.XX    4  1120  127435  131147        0    0    0 02w6d23h       10
xxx.xxx.xxx.XX1   4  1121  424526  133912        0    0    0 02w6d23h    10660
xxx.xxx.xxx.XX2   4  1121  421789  133870        0    0    0 02w6d23h    10659
xxx.xxx.xxx.89    4  6939       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.100   4 57463       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.200   4 57463       0       0        0    0    0 never    Idle (Admin)
194.150.50.161  4  8928 13863098  126935        0    0    0 01w0d11h   250257
xxx.xxx.xxx.1   4 59900  483981  149504        0    0    0 01w1d01h    14050
xxx.xxx.xxx.16  4 34772  149482  124636        0    0    0 01w1d01h        0
xxx.xxx.xxx.31  4  6939 1447122  126566        0    0    0 01w1d01h    80616
xxx.xxx.xxx.254 4 59900  467535  149173        0    0    0 01w1d01h    14015

Total number of neighbors 45
[root@rtr-palata ~]# cat /tmp/snmp_quagga_bgpd_ipsum
BGP router identifier xxx.xxx.xxx.XX.7, local AS number 13004
RIB entries 535152, using 57 MiB of memory
Peers 85, using 379 KiB of memory
RS-Client peers 80, using 357 KiB of memory
Peer groups 2, using 64 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
xxx.xxx.xxx.1    4  1200  142824  127177        0    0    0 6d22h07m        4
xxx.xxx.xxx.168  4 20940  127824  127471        0    0    0 6d22h07m       25
xxx.xxx.xxx.178  4 33873  126480  127268        0    0    0 6d22h07m       10
xxx.xxx.xxx.183  4 16298  144414  128421        0    0    0 17:09:19        1
xxx.xxx.xxx.192  4  1836  131618  127327        0    0    0 4d20h18m       79
xxx.xxx.xxx.216  4 21478  181025  127263        0    0    0 6d22h04m        1
xxx.xxx.xxx.242  4  2484  260715  253599        0    0    0 4d20h17m        1
xxx.xxx.xxx.255  4  6777 27483906  130559        0    0    0 4d20h17m   100417
xxx.xxx.xxx.0    4  6777 27613588  130884        0    0    0 4d20h17m    99391
xxx.xxx.xxx.1    4  1200  142845  127171        0    0    0 6d22h07m        4
xxx.xxx.xxx.34   4 13285  258370  253504        0    0    0 20:35:30      137
xxx.xxx.xxx.110  4 10310  257682  253176        0    0    0 4d20h18m      159
xxx.xxx.xxx.148  4 49685  126976  127249        0    0    0 4d20h18m      115
xxx.xxx.xxx.155  4 25151       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.163  4 10310  257917  253102        0    0    0 4d20h17m      159
xxx.xxx.xxx.208  4 20940  261515  253642        0    0    0 4d20h18m       29
xxx.xxx.xxx.217  4  8365  139433  127290        0    0    0 6d22h06m       45
xxx.xxx.xxx.221  4 41692       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.58   4 42473  129348  127393        0    0    0 4d20h18m       81
xxx.xxx.xxx.144  4 51852       0       0        0    0    0 never    Connect
xxx.xxx.xxx.160  4   714  255788  253257        0    0    0 4d20h18m       20
xxx.xxx.xxx.177  4 41913  142986  127270        0    0    0 6d22h07m       20
xxx.xxx.xxx.183  4   714  255336  252877        0    0    0 4d20h18m       20
xxx.xxx.xxx.x1   4 51852  129717  118481        0    0    0 4d20h18m       15
xxx.xxx.xxx.1    4 59899  149592  137971        0    0    0 01w1d01h     2584
xxx.xxx.xxx.100  4 59899  134930  130857        0    0    0 6d08h03m     2508
xxx.xxx.xxx.8      4 13005       2     833        0    0    0 12w4d07h Idle (Admin)
xxx.xxx.xxx.28     4 13006       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.XX1      4 59900  268277  148716        0    0    0 01w1d01h     2599
xxx.xxx.xxx.XX254    4 59900  268849  148803        0    0    0 01w1d01h     2598
xxx.xxx.xxx.XX.1   4 13004  157535 1583766        0    0    0 01w1d12h     2508
xxx.xxx.xxx.XX.5   4 13004  152889 1556833        0    0    0 02w5d15h     2507
xxx.xxx.xxx.XX1     4  1853  190376  130730        0    0    0 02w6d23h      281
xxx.xxx.xxx.XX2     4  1853  190350  130746        0    0    0 02w6d23h      281
xxx.xxx.xxx.XX    4  1120  127430  131142        0    0    0 02w6d23h       10
xxx.xxx.xxx.XX1   4  1121  424516  133907        0    0    0 02w6d23h    10661
xxx.xxx.xxx.XX2   4  1121  421779  133865        0    0    0 02w6d23h    10660
xxx.xxx.xxx.89    4  6939       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.100   4 57463       0       0        0    0    0 never    Idle (Admin)
xxx.xxx.xxx.200   4 57463       0       0        0    0    0 never    Idle (Admin)
194.150.50.161  4  8928 13862537  126930        0    0    0 01w0d11h   250267
xxx.xxx.xxx.1   4 59900  483969  149499        0    0    0 01w1d01h    14049
xxx.xxx.xxx.16  4 34772  149476  124631        0    0    0 01w1d01h        0
xxx.xxx.xxx.31  4  6939 1446975  126561        0    0    0 01w1d01h    80616
xxx.xxx.xxx.254 4 59900  467522  149168        0    0    0 01w1d01h    14014

Total number of neighbors 45
[root@rtr-palata ~]# ls -alh /tmp/snmp_quagga_bgpd*
-rwxrwxrwx. 1 root root 156K Feb  9 23:19 /tmp/snmp_quagga_bgpd_ipnei
-rwxrwxrwx. 1 root root 3.8K Feb  9 23:19 /tmp/snmp_quagga_bgpd_ipsum
-rwxrwxrwx. 1 root root 7.1K Feb  9 23:19 /tmp/snmp_quagga_bgpd_mem
-rwxrwxrwx. 1 root root  455 Feb  9 23:19 /tmp/snmp_quagga_bgpd_rosum
-rwxrwxrwx. 1 root root   67 Feb  9 23:19 /tmp/snmp_quagga_bgpd_ver
[root@rtr-palata ~]# ls -alh /tmp/snmp_quagga_bgpd*                
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

gslavic, do this:

Code: Select all

/usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl
then type:

Code: Select all

getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2


Output must be like this:

Code: Select all

root@mini:/home/red_neon# /usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl 
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2
.1.3.6.1.4.1.2021.190.1000.3.1.2.1
String
0.99.22.4
^C
root@mini:/home/red_neon# 
"Imagination is more important than Knowledge."
gslavic
Posts: 8
Joined: Tue Feb 09, 2016 5:07 am

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by gslavic »

red_neon wrote:gslavic, do this:

Code: Select all

/usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl
then type:

Code: Select all

getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2


Output must be like this:

Code: Select all

root@mini:/home/red_neon# /usr/bin/perl /etc/srv_scripts/snmp_quagga_bgpd_mon.pl 
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2
.1.3.6.1.4.1.2021.190.1000.3.1.2.1
String
0.99.22.4
^C
root@mini:/home/red_neon# 

Here is the output:
[root@rtr-palata ~]# /usr/bin/perl /usr/local/sbin/snmp_quagga_bgpd_mon.pl
PING
PONG
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2
.1.3.6.1.4.1.2021.190.1000.3.1.2.1
String
0.99.23.1
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.2.1
.1.3.6.1.4.1.2021.190.1000.3.1.3.1
String
XXX.XXX.XXX.XXX <- valid address of our router
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.3
.1.3.6.1.4.1.2021.190.1000.3.1.3.1
String
XXX.XXX.XXX.XXX <- valid address of our router
getnext
.1.3.6.1.4.1.2021.190.1000.3.1.4
.1.3.6.1.4.1.2021.190.1000.3.1.4.1
String
ASASAS <-valid AS number of our router

BUT when I do the "snmp walk"

[root@rtr-XXXXX ~]# snmpwalk -v 1 XXX.XXX.XXX.XXX -c XXXX .1.3.6.1.4.1.2021.190.1000.3
UCD-SNMP-MIB::ucdavis.190.1000.3.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.190.1000.3.1.0.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.190.1000.3.1.1.1 = INTEGER: 2
UCD-SNMP-MIB::ucdavis.190.1000.3.1.2.1 = STRING: "unknown"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.3.1 = STRING: "n/a"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.4.1 = STRING: "n/a"
UCD-SNMP-MIB::ucdavis.190.1000.3.1.5.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.6.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.7.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.8.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.9.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.10.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.1.11.1 = Gauge32: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.2.0 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.190.1000.3.3.0 = INTEGER: 0
User avatar
red_neon
Posts: 24
Joined: Sun Mar 21, 2010 11:50 pm
Location: Moscow, Russia

Re: Monitoring of BGP session via Quagga daemon in Linux

Post by red_neon »

gslavic,

Good, your snmpd daemon is running from user, who does not access to directory /tmp/ (could not reading data from /tmp/snmp_quagga_bgpd* files). Check command line with which runned snmpd and check user (snmp by default) in /etc/passwd. Maybe user snmp is locked in some directory
"Imagination is more important than Knowledge."
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests