Skip to content

Instantly share code, notes, and snippets.

View infotek's full-sized avatar

Jason Ellison infotek

View GitHub Profile
@infotek
infotek / ds-name cleanup
Last active October 6, 2016 22:27
librenms perf data from nagios plugin checks should not exceed 19 characters or conflict with existing ds-names
<?php
$perf = array
(
Qcache_free_memory => array
(
value => 15848240,
uom => ''
),
Qcache_inserts => array
root@shell:/opt/librenms# /usr/lib/nagios/plugins/check_mysql -H localhost -H localhost -d librenms -H localhost -u librenms -p password
Uptime: 637459 Threads: 7 Questions: 644510 Slow queries: 0 Opens: 168 Flush tables: 1 Open tables: 229 Queries per second avg: 1.011|Connections=25744c;;; Open_files=62;;; Open_tables=229;;; Qcache_free_memory=15893496;;; Qcache_hits=276441c;;; Qcache_inserts=112323c;;; Qcache_lowmem_prunes=0c;;; Qcache_not_cached=14095c;;; Qcache_queries_in_cache=543;;; Queries=644510c;;; Questions=644510c;;; Table_locks_waited=0c;;; Threads_connected=7;;; Threads_running=1;;; Uptime=637459c;;;
root@shell:/opt/librenms# echo $?
0
<?php
$perf = array
(
Qcache_free_memory => array
(
value => 15848240,
uom => ''
),
Qcache_inserts => array
<?php
// TEST SCRIPT much better fix
// $command = '/usr/lib/nagios/plugins/check_mysql -u user -p password ' ;
// This array is used to test for valid UOM's to be used for graphing.
// Valid values from: https://nagios-plugins.org/doc/guidelines.html#AEN200
// Note: This array must be decend from 2 char to 1 char so that the search works correctly.
$valid_uom = array ('us', 'ms', 'KB', 'MB', 'GB', 'TB', 'c', 's', '%', 'B');
<?php
//Jason Ellison <infotek@gmail.com>
//This is a test includes/services/check_mysql.inc.php
// provide some sane default
if ($service['service_param']) {
$dbname = $service['service_param'];
} else {
$dbname = "mysql";
root@chat:~# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@chat:~# wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -
root@chat:~# aptitude install freeswitch-meta-all
The following NEW packages will be installed:
freeswitch{a} freeswitch-conf-curl{a} freeswitch-conf-insideout{a} freeswitch-conf-sbc{a} freeswitch-conf-softphone{a}
freeswitch-conf-vanilla{a} freeswitch-lang{a} freeswitch-lang-de{a} freeswitch-lang-en{a} freeswitch-lang-es{a}
freeswitch-lang-fr{a} freeswitch-lang-he{a} freeswitch-lang-pt{a} freeswitch-lang-ru{a} freeswitch-meta-all
freeswitch-meta-codecs{a} freeswitch-meta-conf{a} freeswitch-meta-lang{a} freeswitch-meta-mod-say{a}
freeswitch-mod-abstraction{a} freeswitch-mod-amr{a} freeswitch-mod-amrwb{a} freeswitch-mod-av{a} freeswitch-mod-avmd{a}
freeswitch-mod-b64{a} freeswitch-mod-blacklist{a} freeswitch-mod-bv{a} freeswitch-mod-callcenter{a}
freeswitch-mod-cdr-csv{a} freeswitch-mod-cdr-mongodb{a} freeswitch-mod-cdr-sqlite{a} freeswitch-mod-cidlookup{a}
freeswitch-mod-codec2{a} freeswitch-mod-commands{a} freeswitch-mod-conference{a} freeswitch-mod-console{a}
### Keybase proof
I hereby claim:
* I am infotek on github.
* I am infotek (https://keybase.io/infotek) on keybase.
* I have a public key ASCQSbQ43DTpkgKBa0auFOfpFElGGSc_1mfmgA_B_pDMlwo
To claim this, I am signing this object:
Adding SNMP Informant Standard to librenms
http://docs.librenms.org/Extensions/MIB-based-polling/#how-to-add-a-new-device-mib
SNMP Informant Standard is a 100% free, scaled down version of SNMP Informant Advanced.
agent:
http://www.snmp-informant.com/snmp-informant-standard.htm
mibs:
$ /usr/lib/nagios/plugins/check_pg_localhost -H localhost ais
OK|datid=16384;;; datname=ais;;; numbackends=3;;; xact_commit=22736561;;; xact_rollback=8801054;;; blks_read=3265965;;; blks_hit=84996885;;; tup_returned=74245605;;; tup_fetched=382129;;; tup_inserted=20383790;;; tup_updated=9165;;; tup_deleted=1244;;; conflicts=0;;; temp_files=0;;; temp_bytes=0;;; deadlocks=0;;; blk_read_time=0;;; blk_write_time=0;;;