Prometheus : Query SNMP from a CISCO Switch

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2020
  • Documentation : sbcode.net/prometheus/snmp-ci...
    Course Coupons : sbcode.net/coupons
    I am now going to configure Prometheus to query SNMP from my Cisco Switch.
    My Cisco Switch is a 24 Port Cisco Catalyst 2950.
    After doing a factory reset of the Switch, It has
    SNMP enabled
    The default gateway set to the IP address of my main network router that is connected to the internet
    On my internet firewall/router, I have created a new forwarding rule external port 161 to internal port 161 IP address 192.168.1.1
    I then add my internet routers external IP address to the prometheus.yml configuration for the SNMP scrape target, and Prometheus is now able to query the SNMP properties of my switch through the SNMP exporter process.
    I can verify that i am seeing data in Prometheus by querying the ifInOctets metric. This shows a new metric for every ethernet interface on my Switch.
    Since I have Grafana installed from an earlier lesson. I will also use the SNMP Stats dashboard from the Grafana community.
    This dashboard was written specifically for the if_mib module that is configured in the snmp.yml and referenced in the prometheus.yml for the SNMP job used by the SNMP Exporter.
    #prometheus
    #snmp
    #prometheusCourse
    #prometheusTutorial

ความคิดเห็น • 24

  • @PauloHeaven
    @PauloHeaven 5 หลายเดือนก่อน +2

    Excellent, I got that working with my Netgear and Mikrotik stuff. This software is among the best while being free and open source, but information on how to make it work with SNMP is a bit scarce or goes over too many aspects, and it looked a bit impossible to realize to me as I was just a bit knowledgeable with Grafana and absolutely not with Prometheus. Turns out I did it and you were the one who explained it clearly enough to make this happen.

  • @ToshuMalhotraiitk
    @ToshuMalhotraiitk ปีที่แล้ว +1

    Very thanks, great video.

  • @len4210
    @len4210 3 ปีที่แล้ว +1

    You are the boss

  • @mystay88
    @mystay88 ปีที่แล้ว +1

    Thanks!

  • @valerio53061
    @valerio53061 2 ปีที่แล้ว

    Hello Sean, I also follow you on Udemy, I wanted to ask you if it was possible and how do you import MIB of a router like Aethra and create a template, would you evaluate the economic aspect?

  • @luchobeto
    @luchobeto ปีที่แล้ว +1

    what about defining a community different from public ?

  • @0605hector
    @0605hector 2 ปีที่แล้ว

    Hi, at min: 4:52min , how did you add basic authentication to Prometheus web page?

    • @sbcode
      @sbcode  2 ปีที่แล้ว

      sbcode.net/prometheus/prometheus-basic-auth/

  • @js8905
    @js8905 3 ปีที่แล้ว

    Could it somehow be configured to see a Cisco switch attached to a computer with two NIC/networks? One NIC can ping the Prometheus server, and the second NIC has a Cisco with devices that cannot ping the Prometheus sever?

    • @sbcode
      @sbcode  3 ปีที่แล้ว +1

      use different subnets

    • @js8905
      @js8905 3 ปีที่แล้ว

      @@sbcode the switch I hope to monitor is on NIC2 of a server-B that has to be physically isolated from the main network on NIC1 of server-B that allows server-B to connect to grafana on server-A. Is there a exporter or method to get performance data from the switch on the NIC2 network to the grafana server on the NIC1 network? Thanks in advance for any help.

    • @sbcode
      @sbcode  3 ปีที่แล้ว

      your problem sounds like network layer problems to solve. Use your cisco documentation to manage VLANs and ACLs.
      Prometheus/Grafana are application layer and can only access what the network allows.
      If you want to prevent access to Prometheus/Grafana from end users, you can use various IP blocking techniques such as firewall rules, iptables rules on server, use an Nginx reverse proxy with IP restrictions, and also add Basic Authentication to Prometheus using Nginx. Some of those techniques are discussed here. sbcode.net/prometheus/nginx-prometheus/

  • @Tibrus74
    @Tibrus74 3 ปีที่แล้ว

    Dommage on ne sait pas comment installer la partie if_mib et le snmp_explorer pour permettre ensuite l'ajout de CI Cisco
    Voir ou ajouter la communauté snmp dans la conf pour correspondre a celle sur le Cisco

    • @sbcode
      @sbcode  3 ปีที่แล้ว +1

      see sbcode.net/prometheus/snmp/ and the next pages in the series

    • @Tibrus74
      @Tibrus74 3 ปีที่แล้ว

      @@sbcode Not easy, but that's work :)

  • @luanminh4870
    @luanminh4870 3 ปีที่แล้ว

    Hi bro! How do we query SNMP from a Fortigate Firewall?

    • @sbcode
      @sbcode  3 ปีที่แล้ว

      import a fortigate template. Or create your own after looking through all my SNMP tutorials. sbcode.net/zabbix/setup-snmp-host/

    • @luanminh4870
      @luanminh4870 3 ปีที่แล้ว

      @@sbcode I am using promethues and grafana, non-zabbix

    • @sbcode
      @sbcode  3 ปีที่แล้ว

      How you view SNMP in Grafana depends on which data source you are using. If you want to use Prometheus, then I have many videos on the Prometheus SNMP exporter staring at sbcode.net/prometheus/snmp/
      I am not aware of a Fortigate module for the Prometheus SNMP exporter, but there probably is one on the internet somewhere. You could also create your own if you new which OIDs you wanted. My videos show you how to go about creating your own.

  • @PrashanAttanayake
    @PrashanAttanayake 3 ปีที่แล้ว +1

    I'm getting the following error "server returned HTTP status 500 Internal Server Error. How can I mitigate this ?

    • @sbcode
      @sbcode  3 ปีที่แล้ว

      how do you get this error? this is a HTTP error, not SNMP

    • @PrashanAttanayake
      @PrashanAttanayake 3 ปีที่แล้ว

      @@sbcode 1stly i got context deadline exceeded , then I increase scrape interval time to 100s, after that I come across with HTTP status error. Also I check with 9116 port, I got following error as well An error has occurred while serving metrics:
      **> **
      > error collecting metric Desc{fqName: “snmp_error”, help: “Error scraping target”, constLabels: {}, variableLabels: []}: error getting target X.X.0.254: request timeout (after 3 retries)......node exporter working well

    • @sbcode
      @sbcode  3 ปีที่แล้ว

      sorry, I've never seen this problem. It may be a symptom of something else completely unrelated.

    • @capitainethug5550
      @capitainethug5550 10 หลายเดือนก่อน

      same for me on cisco 3750g