Generate config file for Junos 12.3

751 views
Skip to first unread message

Oucema Bellagha

unread,
Nov 27, 2017, 10:29:01 AM11/27/17
to Prometheus Users

Host operating system: output of uname -a

16.04.1-Ubuntu SMP

snmp_exporter version: output of snmp_exporter -version

snmp_exporter, version 0.8.0

What device/snmpwalk OID are you using?

SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. ex2200-24t-4g Ethernet Switch, kernel JUNOS 12.3R9.4, Build date: 2015-02-12 11:18:43 UTC Copyright (c) 1996-2015 Juniper Networks, Inc.

If this is a new device, please link to the MIB(s).

https://www.juniper.net/techpubs/software/junos/junos123/juniper-mibs-12.3R12.4.tgz

So now I extracted the juniper-mibs-12.3R12.4.tgz to $HOME/.snmp/mib as described in README but then when I try ./generator generate the snmp.yml file doesn't contain any module or configuration of Juniper MIB - is there anything I missed or how can I get an snmp.yml file for my Junos device?



Ben Kochie

unread,
Nov 27, 2017, 11:14:34 AM11/27/17
to Oucema Bellagha, Prometheus Users
I think there are a couple things going on here.

#1 - The timeout makes me think you have an SNMP community problem.  The default snmp.yml config the exporter ships with for `if_mib` is "public".  If you have a different community string you will need to add this to the generator and run it.

#2 - What changes to the generator.yml have you made?  It doesn't seem like you need any, and you don't need the juniper MIBs if you are just going to use `if_mib`.

Are there any specific sections of the Juniper MIB that you care about?  The generator does not look throught the MIBs directory and generate everything, it takes a specific set of walks configured in the generator.yml and then uses the MIBs to generate the metrics available via those walks.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/a37085c3-a611-416d-923c-dd974cc1a24f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oucema Bellagha

unread,
Nov 27, 2017, 11:41:37 AM11/27/17
to Prometheus Users
Hey there,

So I do have a  community public in my switch config:
client-list list0 {
    x
.x.x.x/24;
}
community grandstream11
{
    authorization read
-only;
}
community
public {
    authorization read
-only;
    client
-list-name list0;
}


for the generator.yml I have following config:
modules:
 
# Default IF-MIB interfaces table with ifIndex.
  if_mib
:
    walk
: [sysUpTime, interfaces, ifXTable]
 
# Interfaces if ifAlias is unique.
  if_mib_ifalias
:
    walk
: [sysUpTime, interfaces, ifXTable]
    lookups
:
     
- old_index: ifIndex
        new_index
: ifAlias
 
# Interfaces if ifDescr is unique.
  if_mib_ifdescr
:
    walk
: [sysUpTime, interfaces, ifXTable]
    lookups
:
     
- old_index: ifIndex
        new_index
: ifDescr
 
# Interfaces if ifName is unique.
  if_mib_ifname
:
    walk
: [sysUpTime, interfaces, ifXTable]
    lookups
:
     
- old_index: ifIndex
       
# Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
        new_index
: 1.3.6.1.2.1.31.1.1.1.1 # ifName


and for monitoring I just need to monitor basic metrics: cpu, ram, Interface(up/down) and network Speed now the MIB of Junos contains a lot of information but I'm not really sure how to get even these basic metrics and the command:
snmpwalk -v 2c -c public x.x.x.x SNMPv2-MIB::sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. ex2200-24t-4g Ethernet Switch, kernel JUNOS 12.3R9.4, Build date: 2015-02-12 11:18:43 UTC Copyright (c) 1996-2015 Juniper Networks, Inc.is

is giving output so something is wrong with my snmp.yml file generated obviously by the generator.yml above.

Oucema Bellagha

unread,
Nov 29, 2017, 4:07:06 AM11/29/17
to Prometheus Users
Up.

Michael Van

unread,
Dec 12, 2019, 7:59:43 PM12/12/19
to Prometheus Users
Hi,

I am also having difficulty with Prometheus and Juniper. Can you help me?

Regards

Vào 22:29:01 UTC+7 Thứ Hai, ngày 27 tháng 11 năm 2017, Oucema Bellagha đã viết:
Reply all
Reply to author
Forward
0 new messages