This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plotly.graph_objects as go | |
| import dash | |
| from dash import dcc, html | |
| import requests | |
| from dash.dependencies import Input, Output | |
| app = dash.Dash(__name__) | |
| app.layout = html.Div([ | |
| #Display the graph - specify the callback to call on | |
| dcc.Graph(id='live-update-graph'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Remove blank lines from a text file | |
| sed -i '/^$/d' file.txt | |
| # Delete line 7000 with sed | |
| sed -i '7000d' file.txt | |
| # Replace 'Earth' with 'Globe' "globally" | |
| sed -i 's/Earth/Globe/g' file.txt | |
| # Replace 'Earth' with 'Globe' "globally" in multiple files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_nfs.sh | |
| ---------------------------------------------------------------- | |
| #!/bin/sh | |
| RC=0 | |
| NAGIOS_CRIT=2 | |
| NAGIOS_OK=0 | |
| NAGIOS_WARN=1 | |
| FS="/NFS" | |
| # Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_hw | |
| ------------------------------------------------------ | |
| #!/bin/sh | |
| HW=$(cat /proc/device-tree/model | tr '\0' '\n') | |
| echo $HW | |
| exit 0 | |
| ------------------------------------------------------ | |
| /etc/nagios/nrpe.cfg | egrep -v '#|^$' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_os | |
| ------------------------------------------------------------ | |
| #!/bin/sh | |
| OS=$(cat /etc/os-release | grep PRETTY_NAME | awk -F"=" '{print $2}' | sed -s 's/"//g') | |
| echo $OS | |
| exit 0 | |
| ------------------------------------------------------------ | |
| /etc/nagios/nrpe.cfg | egrep -v '#|^$' | |
| ------------------------------------------------------------ | |
| command[check_users]=/usr/lib/nagios/plugins/check_users -w 3 -c 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_throttled | |
| --------------------------------------------------------------------- | |
| #!/bin/sh | |
| OS=$(cat /etc/os-release | grep PRETTY_NAME | awk -F"=" '{print $2}' | sed -s 's/"//g') | |
| echo $OS | |
| exit 0 | |
| pi@livingtemp:~ $ cat /usr/lib/nagios/plugins/check_throttled | |
| #!/bin/sh | |
| throttled="$(vcgencmd get_throttled)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_voltage | |
| ----------------------------------------------------- | |
| #!/bin/sh | |
| voltage=$(for i in core sdram_c sdram_i sdram_p ; do echo $i `/opt/vc/bin/vcgencmd measure_volts $i`; done) | |
| echo $voltage | awk -F"V " '{print $1"V\n"$2"V\n"$3"V\n"$4}' | |
| exit 0 | |
| ------------------------------------------------------------ | |
| /etc/nagios/nrpe.cfg | egrep -v '#|^$' | |
| ------------------------------------------------------------ | |
| command[check_users]=/usr/lib/nagios/plugins/check_users -w 3 -c 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/lib/nagios/plugins/check_rasp_temp | |
| --------------------------------------------------------- | |
| #!/bin/bash | |
| # Adapted from check_nagios_latency | |
| VCGENCMD="/opt/vc/bin/vcgencmd" | |
| # Prints usage information | |
| usage() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d3-diagram.html | |
| -------------------------------------------------------------------- | |
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <head> | |
| <style> | |
| body {font-family: 'Arial'; | |
| background: #000000;} | |
| </style> | |
| <svg width="960" height="600"></svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os | |
| import time | |
| if os.path.isdir('/sys/bus/w1/devices/28-011111ffffff/'): | |
| os.system('/sbin/modprobe w1-gpio') | |
| os.system('/sbin/modprobe w1-therm') | |
| temp_sensor = '/sys/bus/w1/devices/28-011111ffffff/w1_slave' |