Skip to content

Instantly share code, notes, and snippets.

@ericpulvino
ericpulvino / netq oom check
Created July 11, 2018 02:05
checks the netq ts for OOM condition
#!/bin/bash
used_memory=$(redis-cli info memory | grep "used_memory:" | cut -d ":" -f2 | tr -d '\r' )
max_memory=$(redis-cli info memory | grep "maxmemory:" | cut -d ":" -f2 | tr -d '\r' )
if [[ "$used_memory" -gt "$max_memory" ]]
then
echo "ALERT -- NETQ TS is consuming too much memory!!!"
else
echo "INFO: Memory level on the NetQ TS server is within acceptable limits $used_memory/$max_memory bytes in use."
cumulus@leaf03:~$ sudo su
root@leaf03:/home/cumulus# cat << EOT > /etc/apt/sources.list.d/jessie.list
> deb http://deb.debian.org/debian jessie main
> deb-src http://deb.debian.org/debian jessie main
>
> deb http://deb.debian.org/debian jessie-updates main
> deb-src http://deb.debian.org/debian jessie-updates main
> EOT
root@leaf03:/home/cumulus# apt-get udpate -y
E: Command line option 'y' [from -y] is not known.
@ericpulvino
ericpulvino / cl_support_lldp_parser.py
Created September 9, 2019 14:44
Script to create a dot file from CL-supports
#!/usr/bin/env python
import os
import sys
import glob
import shutil
import tarfile
import subprocess
@ericpulvino
ericpulvino / runbook for fixing netaddr
Created September 28, 2019 03:35
Method to update the out of date MAC/OUI database in the python3 netaddr library
$ sudo pip3 install netaddr
[sudo] password for eric:
The directory '/home/eric/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/eric/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting netaddr
Downloading https://files.pythonhosted.org/packages/ba/97/ce14451a9fd7bdb5a397abf99b24a1a6bb7a1a440b019bebd2e9a0dbec74/netaddr-0.7.19-py2.py3-none-any.whl (1.6MB)
100% |████████████████████████████████| 1.6MB 978kB/s
Installing collected packages: netaddr
Successfully installed netaddr-0.7.19
[23:24] eric @ p52: ~
@ericpulvino
ericpulvino / gist:d813d32a1892acb79b21ee258e214e93
Last active October 14, 2022 17:14
Update Source working in 5.3.0_prerelease
cumulus@cl-vx1:mgmt:~$ cat /etc/image-release
IMAGE_ID="Cumulus Linux"
IMAGE_RELEASE=5.3.0
IMAGE_DESCRIPTION="Cumulus Linux 5.3.0"
IMAGE_SWITCH_ARCHITECTURE=vx-amd64
IMAGE_BUILD_ID=18735a9z2060b1386
IMAGE_BUILD_SERIAL_ID=5.dev.2418
IMAGE_BUILD_DATE=2022-10-13T18:38:26+00:00
IMAGE_BUILD_USER=sw-r2d2-bot