Posted on March 3, 2021 3:30 pm
 |  Asked by Andrea Vivaldi
 |  116 views
RESOLVED
2
0
Print Friendly, PDF & Email

Hi all,

I was wondering if there was the possibility to test Prometheus-based streaming telemetry in a lab provided by cEOS docker container.

Is there a change to configure and install TerminAttr and ocprometheus on the cEOS image or it is simply impossible? Anyone that have had success?

 

Thanks

Andrea

2
Posted by Tamas Plugor
Answered on March 3, 2021 3:34 pm

You can test ocprometheus on any EOS flavor, be it vEOS-lab/cloudEOS/cEOS/cEOS-lab/EOS/CVX

There's nothing different in the way you'll have to install and use it, you might find these resources useful:

https://eos.arista.com/streaming-eos-telemetry-states-to-prometheus/

https://github.com/aristanetworks/goarista/tree/master/cmd/ocprometheus

I've used it many times in my lab, a very simple example:

Import the image in docker:

~/images # tamas@tamas # docker import cEOS64-lab-4.23.3.tar.xz ceosimage:c4233M

Create docker network if it’s not already created:

~/images # tamas@tamas # docker network create net1337

 

Create docker container:

~/images # tamas@tamas # docker create --name=ceos1337 -p 2222:22 -p 4000:8080 -p 4001:6030 -p 4002:6061 -p 4003:8081 -p 4423:443 --privileged -e INTFTYPE=eth -e ETBA=4 -e SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1 -e CEOS=1 -e EOS_PLATFORM=ceoslab -e container=docker -i -t ceosimage:c4233M /sbin/init systemd.setenv=INTFTYPE=eth systemd.setenv=ETBA=4 systemd.setenv=SKIP_ZEROTOUCH_BARRIER_IN_SYSDBINIT=1 systemd.setenv=CEOS=1 systemd.setenv=EOS_PLATFORM=ceoslab systemd.setenv=container=docker systemd.setenv=MAPETH0=1 systemd.setenv=MGMT_INTF=eth0

 

Connect the container to the network

~/images # tamas@tamas # docker network connect net1337 ceos1337


Start container

 

~/images # tamas@tamas # docker start ceos1337

 

 Exec into the container (console)

 

~/images # tamas@tamas # docker exec -it ceos1337 Cli

Sample config

 

cEOS1(config)#sh run
! Command: show running-config
! device: cEOS1 (cEOSLab, EOS-4.23.3M)
!
daemon ocprometheus
   exec /mnt/flash/ocprometheus -config /mnt/flash/ocprometheus.yml -addr localhost:6030
   no shutdown
!
transceiver qsfp default-mode 4x10G
!
agent Bfd shutdown
agent PowerManager shutdown
agent LedPolicy shutdown
agent Thermostat shutdown
agent PowerFuse shutdown
agent StandbyCpld shutdown
agent LicenseManager shutdown
!
hostname cEOS1
!
spanning-tree mode mstp
!
no aaa root
!
interface Ethernet1
!
interface Management0
   ip address 172.17.0.2/24
!
ip access-list def2
   10 permit icmp any any
   20 permit ip any any tracked
   30 permit udp any any eq bfd ttl eq 255
   40 permit udp any any eq bfd-echo ttl eq 254
   50 permit udp any any eq multihop-bfd
   60 permit udp any any eq micro-bfd
   70 permit udp any any eq sbfd
   80 permit udp any eq sbfd any eq sbfd-initiator
   90 permit ospf any any
   100 permit tcp any any eq ssh telnet www snmp bgp https msdp ldp netconf-ssh gnmi
   110 permit udp any any eq bootps bootpc ntp snmp rip ldp
   120 permit tcp any any eq mlag ttl eq 255
   130 permit udp any any eq mlag ttl eq 255
   140 permit vrrp any any
   150 permit ahp any any
   160 permit pim any any
   170 permit igmp any any
   180 permit tcp any any range 5900 5910
   190 permit tcp any any range 50000 50100
   200 permit udp any any range 51000 51100
   210 permit tcp any any eq 3333
   220 permit tcp any any eq nat ttl eq 255
   230 permit tcp any eq bgp any
   240 permit rsvp any any
   250 permit tcp any any eq 6040
   260 permit tcp any any eq 8080
!
no ip routing
!
system control-plane
   ip access-group def2 in
!
management api gnmi
   transport grpc def
   provider eos-native
!
ip route 0.0.0.0/0 172.17.0.1
!
end

 

How to copy the ocprometheus binary if you forgot to expose SSH?

 

docker cp ocprometheus ceos1337:/mnt/flash/

 

HTH,

Tamas

Post your Answer

You must be logged in to post an answer.