Skip to content

Instantly share code, notes, and snippets.

View infotek's full-sized avatar

Jason Ellison infotek

View GitHub Profile
@infotek
infotek / gist:f18fffd050bb6603b42da802d6b98e1c
Created December 17, 2020 21:24
npgsql problem connecting to postgresql v13 (worked with postgresql 9.6)
ERROR 2020-12-16 16:02:44,499 333535ms Archive rieveUnlimitedData - Npgsql.NpgsqlException (0x80004005): Exception while reading from stream ---> System.TimeoutException: Timeout during reading attempt
at Npgsql.NpgsqlConnector.<<ReadMessage>g__ReadMessageLong|194_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Npgsql.NpgsqlDataReader.<>c__DisplayClass41_0.<<ReadMessage>g__ReadMessageSequential|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
$ /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;;;
@infotek
infotek / gist:bbe825f15658067bb50ec4920455c833
Last active March 2, 2018 16:44
nagios plugins not graphing
./check-services.php -d
DEBUG!
SQL[SELECT * FROM `devices` AS D, `services` AS S WHERE S.device_id = D.device_id ORDER by D.device_id DESC]
<SNIP>
Nagios Service - 28
Request: /usr/lib/nagios/plugins/check_pg_localhost -H localhost ais
Perf Data - DS: datid, Value: 16384, UOM:
Perf Data - DS: datname, Value: ai, UOM: s
Perf Data - DS: numbackends, Value: 3, UOM:
### 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:
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}
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 -
<?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";
<?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
$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