<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iwillfearnoevil.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chubbard</id>
	<title>I Will Fear No Evil - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iwillfearnoevil.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chubbard"/>
	<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Special:Contributions/Chubbard"/>
	<updated>2026-10-13T08:28:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=KVM_Gotchas&amp;diff=697</id>
		<title>KVM Gotchas</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=KVM_Gotchas&amp;diff=697"/>
		<updated>2026-09-30T17:50:15Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Common useful commands for KVM Guests====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LVM error fixes:&lt;br /&gt;
* not exclusive for KVM, but since I have so many of these VM's thats where I see it a lot.&lt;br /&gt;
* commonly happens when do-release-upgrade is run, or when some updates happen to the lvm code.  My GUESS is that the metadata contains the lvm version in there somewhere and does not get updated.&lt;br /&gt;
* This fix is only for the metadata&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  WARNING: PV /dev/sda5 in VG dns01-vg is using an old PV header, modify the VG to update.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vgck --updatemetadata dns01-vg&lt;br /&gt;
vgck --updatemetadata &amp;lt;VG Name from warning message&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create new Image ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qemu-img create -f qcow2 -o preallocation=metadata FILENAME.qcow2 XXXG&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Repair damaged guest disk ==&lt;br /&gt;
This is the fourth time I have had to do this after power outages..  Document it dummy!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE=/media/kvm/some_disk_image&lt;br /&gt;
sudo cp --reflink=auto --sparse=always &amp;quot;$IMAGE&amp;quot; &amp;quot;${IMAGE}.before-fsck&amp;quot;&lt;br /&gt;
sudo modprobe nbd max_part=16&lt;br /&gt;
sudo qemu-nbd --connect=/dev/nbd0 &amp;quot;$IMAGE&amp;quot;&lt;br /&gt;
sudo partprobe /dev/nbd0&lt;br /&gt;
sudo udevadm settle&lt;br /&gt;
lsblk -f /dev/nbd0&lt;br /&gt;
sudo blkid /dev/nbd0p*&lt;br /&gt;
sudo e2fsck -f /dev/87ef1064-be4b-40dd-90d4-1d10ba844913&lt;br /&gt;
sudo e2fsck -f /dev/nbd0p1 -y&lt;br /&gt;
sudo qemu-nbd --disconnect /dev/nbd0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-common-checks&amp;diff=696</id>
		<title>Bash-common-checks</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-common-checks&amp;diff=696"/>
		<updated>2026-09-29T14:30:24Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Definition for parameter expansion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Somewhat uncommon bash commands to use in formatting or logic in a bash script.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
===Common checks and validations that are a PITA to remember===&lt;br /&gt;
====Is Integer?====&lt;br /&gt;
* Check if a var is an integer&lt;br /&gt;
* support negative as well as positive integer values using extended regex&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VAR=123&lt;br /&gt;
if [[ ${VAR} =~ ^-?[0-9]+$ ]]; then&lt;br /&gt;
  echo &amp;quot;Is integer&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Is not integer&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====TCP port check====&lt;br /&gt;
* leverage /dev&lt;br /&gt;
* use timeout for sanity&lt;br /&gt;
* Use for any kind of TCP knock&lt;br /&gt;
* do not use FQDN, go by IP&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IP=192.168.15.100&lt;br /&gt;
timeout 1 bash -c &amp;quot;&amp;lt;/dev/tcp/${IP}/22&amp;quot;&lt;br /&gt;
if [[ $? -ne 0 ]]; then&lt;br /&gt;
  echo &amp;quot;ssh port closed at $IP&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;ssh port open at $IP&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Find what using inodes====&lt;br /&gt;
* use sudo if you are going against /&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Make a banner====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
skull(){&lt;br /&gt;
cat &amp;lt;&amp;lt; EIEIO&lt;br /&gt;
*************************************************************&lt;br /&gt;
*                                                           *&lt;br /&gt;
*   .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.      *&lt;br /&gt;
*   |                     ______                     |      *&lt;br /&gt;
*   |                  .-&amp;quot;      &amp;quot;-.                  |      *&lt;br /&gt;
*   |                 /            \                 |      *&lt;br /&gt;
*   |     _          |              |          _     |      *&lt;br /&gt;
*   |    ( \         |,  .-.  .-.  ,|         / )    |      *&lt;br /&gt;
*   |     &amp;gt; &amp;quot;=._     | )(__/  \__)( |     _.=&amp;quot; &amp;lt;     |      *&lt;br /&gt;
*   |    (_/&amp;quot;=._&amp;quot;=._ |/     /\     \| _.=&amp;quot;_.=&amp;quot;\_)    |      *&lt;br /&gt;
*   |           &amp;quot;=._&amp;quot;(_     ^^     _)&amp;quot;_.=&amp;quot;           |      *&lt;br /&gt;
*   |               &amp;quot;=\__|IIIIII|__/=&amp;quot;               |      *&lt;br /&gt;
*   |              _.=&amp;quot;| \IIIIII/ |&amp;quot;=._              |      *&lt;br /&gt;
*   |    _     _.=&amp;quot;_.=&amp;quot;\          /&amp;quot;=._&amp;quot;=._     _    |      *&lt;br /&gt;
*   |   ( \_.=&amp;quot;_.=&amp;quot;     '--------'     &amp;quot;=._&amp;quot;=._/ )   |      *&lt;br /&gt;
*   |    &amp;gt; _.=&amp;quot;                            &amp;quot;=._ &amp;lt;    |      *&lt;br /&gt;
*   |   (_/                                    \_)   |      *&lt;br /&gt;
*   |                                                |      *&lt;br /&gt;
*   '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='      *&lt;br /&gt;
*                                                           *&lt;br /&gt;
*                   Abandon All Hope                        *&lt;br /&gt;
*************************************************************/&lt;br /&gt;
EIEIO&lt;br /&gt;
}&lt;br /&gt;
# abandon all hope ye who enter here&lt;br /&gt;
skull&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Create a CRC16 against string====&lt;br /&gt;
* use caution in creating unique values &amp;lt; 65k, as there can be slop and overlap&lt;br /&gt;
* Good quick and dirty creation that is reproducible&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STRING=foo&lt;br /&gt;
crc16() {&lt;br /&gt;
    while read -r -d &amp;quot;&amp;quot; -n 1 ; do astring+=( &amp;quot;$REPLY&amp;quot; ) ; done &amp;lt;&amp;lt;&amp;lt; &amp;quot;$1&amp;quot;&lt;br /&gt;
    cnt=${#1}&lt;br /&gt;
    c=65535&lt;br /&gt;
    for ((x=0;x&amp;lt;$cnt;x++)); do&lt;br /&gt;
        char=$(printf '%d' \'&amp;quot;${1:$x:1}&amp;quot;)&lt;br /&gt;
        e=$(((c ^ char) &amp;amp; 0x00FF))&lt;br /&gt;
        s=$(((e &amp;lt;&amp;lt; 4) &amp;amp; 0x00FF))&lt;br /&gt;
        f=$(((e ^ s) &amp;amp; 0x00FF))&lt;br /&gt;
        r1=$(((c &amp;gt;&amp;gt; 8) ^ (f &amp;lt;&amp;lt; 8) ^ (f &amp;lt;&amp;lt; 3) ^ (f &amp;gt;&amp;gt; 4)))&lt;br /&gt;
        c=$r1&lt;br /&gt;
    done&lt;br /&gt;
    c=$((c ^ 0xffff))&lt;br /&gt;
    echo &amp;quot;$c&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
crc16 ${STRING}&lt;br /&gt;
returns value 26676&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Generate random string====&lt;br /&gt;
* Great for creating a password&lt;br /&gt;
* no reserved chars get generated&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 20 | tr -d '\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Create CRC32 from string====&lt;br /&gt;
* just to be complete... :) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crc32 &amp;lt;(echo &amp;quot;LongString&amp;quot;)&lt;br /&gt;
1624d322&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Generate HEX for string====&lt;br /&gt;
* Note this is not able to do the reverse&lt;br /&gt;
* No found method to convert the output back to LongString so this is buggy&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo -n &amp;quot;LongString&amp;quot;  | cksum | cut -d &amp;quot; &amp;quot;  -f1 | xargs echo printf '%0X\\n' | sh&lt;br /&gt;
5751BDB2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Convert first letter to Upper case====&lt;br /&gt;
* PROJECT=testproject&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PROJECT=&amp;quot;$(tr '[:lower:]' '[:upper:]' &amp;lt;&amp;lt;&amp;lt; ${PROJECT:0:1})${PROJECT:1}&amp;quot; &lt;br /&gt;
echo ${PROJECT}&lt;br /&gt;
Testproject&lt;br /&gt;
&lt;br /&gt;
Using tr, this will make the first letter always upper case and ignore the&lt;br /&gt;
remainder of the string&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Make leading zeros for output ====&lt;br /&gt;
* make 2 say 02 instead&lt;br /&gt;
* change the % values for things such as decimal precision or more leading numbers&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$(printf &amp;quot;%02d&amp;quot; 2)&lt;br /&gt;
02&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Stupid loop I keep forgetting====&lt;br /&gt;
Used for renaming television episodes when what you think is a season does not match what tbdb thinks is a season&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 for x in $(seq 1 12); do z=$(( $x + 12 )); y=$(printf &amp;quot;%02d&amp;quot; $x) ; s2='s02e' ; s1='s01e'; if=$(ls ./*$s2$y*) ; fn=$(echo $if | sed &amp;quot;s/$s2$y/$s1$z/&amp;quot;) ; mv $if $fn ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Function return code examples====&lt;br /&gt;
[https://stackoverflow.com/questions/17336915/return-value-in-a-bash-function| Stack Overflow source]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash -e&lt;br /&gt;
function func1() {&lt;br /&gt;
   return ${1:-0}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function func2() {&lt;br /&gt;
   local RVAL=&amp;quot;&amp;quot;&lt;br /&gt;
   RVAL=$(func1 ${1:-0} &amp;amp;&amp;amp; echo 0 || echo $?)&lt;br /&gt;
   if [[ $RVAL != &amp;quot;0&amp;quot; ]]; then&lt;br /&gt;
      echo &amp;quot;Some logic on exit code $RVAL&amp;quot;&lt;br /&gt;
      exit $RVAL&lt;br /&gt;
   fi&lt;br /&gt;
   echo &amp;quot;Some logic on exit code 0&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
func2 ${1:-0}&lt;br /&gt;
Some basic tests&lt;br /&gt;
&lt;br /&gt;
$ ./test.sh&lt;br /&gt;
Some logic on exit code 0&lt;br /&gt;
$ echo $?&lt;br /&gt;
0&lt;br /&gt;
$ ./test.sh 128&lt;br /&gt;
Some logic on exit code 128&lt;br /&gt;
$ echo $?&lt;br /&gt;
128&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Definition for parameter expansion====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In Bash, the syntax return ${1:-0} is a way to return a value from a function, with a default value if the first argument ($1) is not provided. Here's a breakdown of the components:&lt;br /&gt;
&lt;br /&gt;
    ${1:-0}:&lt;br /&gt;
        ${1} refers to the first positional parameter passed to the script or function.&lt;br /&gt;
        :- is a parameter expansion operator that provides a default value.&lt;br /&gt;
        0 is the default value.&lt;br /&gt;
&lt;br /&gt;
    Therefore, ${1:-0} means &amp;quot;use the value of the first argument if it's provided; otherwise, use 0.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    return:&lt;br /&gt;
        This command is used within a function to return an exit status. The exit status is a numeric value (0-255) that indicates success (0) or failure (non-zero).&lt;br /&gt;
&lt;br /&gt;
Putting it all together, return ${1:-0} means:&lt;br /&gt;
&lt;br /&gt;
    If the function is called with an argument, return the value of that argument.&lt;br /&gt;
    If no argument is provided, return 0.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Count number of occurrences of a specific character====&lt;br /&gt;
A nice simple way to count in this case the number of periods in a variable.  I like this more than some of the other solutions I have seen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VALUE=&amp;quot;this.is.a.test.string&amp;quot;&lt;br /&gt;
DOTS=&amp;quot;${VALUE//[^.]/}&amp;quot;&lt;br /&gt;
echo &amp;quot;${#DOTS}&amp;quot;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category: Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Tcpdump_find_dhcp_leased&amp;diff=695</id>
		<title>Tcpdump find dhcp leased</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Tcpdump_find_dhcp_leased&amp;diff=695"/>
		<updated>2026-09-10T18:31:53Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Different examples of useful tcpdump commands.  [https://unixhealthcheck.com/blog?id=433 | original source dhcp dump ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tcpdump -i eth0 port 67 or port 68 -e -n -vv&lt;br /&gt;
&lt;br /&gt;
Client-ID Option 61, length 7: ether ec:9b:f3:6b:97:4b&lt;br /&gt;
Requested-IP Option 50, length 4: 192.168.0.3&lt;br /&gt;
Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
MSZ Option 57, length 2: 1500&lt;br /&gt;
Vendor-Class Option 60, length 16: &amp;quot;android-dhcp-7.0&amp;quot;&lt;br /&gt;
Hostname Option 12, length 16: &amp;quot;SAMSUNG-SM-G890A&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@gateway01 ~]# tcpdump -i enp3s0 port 67 or port 68 -e -n -vv&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
15:06:34.111043 ea:d3:1b:51:95:18 &amp;gt; Broadcast, ethertype IPv4 (0x0800), length 356: (tos 0x10, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 342)&lt;br /&gt;
    0.0.0.0.bootpc &amp;gt; 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from ea:d3:1b:51:95:18, length 314, xid 0x6c5efb8c, Flags [none] (0x0000)&lt;br /&gt;
	  Client-Ethernet-Address ea:d3:1b:51:95:18&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: Request&lt;br /&gt;
	    Client-ID Option 61, length 7: ether ea:d3:1b:51:95:18&lt;br /&gt;
	    Requested-IP Option 50, length 4: 192.168.15.207&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
	    MSZ Option 57, length 2: 1500&lt;br /&gt;
	    Vendor-Class Option 60, length 15: &amp;quot;android-dhcp-13&amp;quot;&lt;br /&gt;
	    Hostname Option 12, length 11: &amp;quot;Chris-s-A32&amp;quot;&lt;br /&gt;
	    Parameter-Request Option 55, length 12: &lt;br /&gt;
	      Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name&lt;br /&gt;
	      MTU, BR, Lease-Time, RN&lt;br /&gt;
	      RB, Vendor-Option, URL, Option 108&lt;br /&gt;
15:06:34.111594 00:e0:4c:10:0a:d3 &amp;gt; Broadcast, ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 26216, offset 0, flags [none], proto UDP (17), length 328)&lt;br /&gt;
    192.168.15.1.bootps &amp;gt; 255.255.255.255.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x6c5efb8c, Flags [Broadcast] (0x8000)&lt;br /&gt;
	  Client-Ethernet-Address ea:d3:1b:51:95:18&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: NACK&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.15.1&lt;br /&gt;
	    MSG Option 56, length 15: &amp;quot;wrong server-ID&amp;quot;&lt;br /&gt;
15:06:34.193893 1c:1b:0d:0b:14:1f &amp;gt; ea:d3:1b:51:95:18, ethertype IPv4 (0x0800), length 363: (tos 0xc0, ttl 64, id 62733, offset 0, flags [none], proto UDP (17), length 349)&lt;br /&gt;
    192.168.0.1.bootps &amp;gt; 192.168.15.207.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 321, xid 0x6c5efb8c, Flags [none] (0x0000)&lt;br /&gt;
	  Your-IP 192.168.15.207&lt;br /&gt;
	  Server-IP 192.168.0.1&lt;br /&gt;
	  Client-Ethernet-Address ea:d3:1b:51:95:18&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: ACK&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
	    Lease-Time Option 51, length 4: 43200&lt;br /&gt;
	    RN Option 58, length 4: 21600&lt;br /&gt;
	    RB Option 59, length 4: 37800&lt;br /&gt;
	    Domain-Name Option 15, length 19: &amp;quot;iwillfearnoevil.com&amp;quot;&lt;br /&gt;
	    Domain-Name-Server Option 6, length 12: 192.168.0.1,192.168.15.176,8.8.8.8&lt;br /&gt;
	    Default-Gateway Option 3, length 4: 192.168.0.1&lt;br /&gt;
	    BR Option 28, length 4: 192.168.15.255&lt;br /&gt;
	    Subnet-Mask Option 1, length 4: 255.255.240.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo tcpdump -i any -n -vvv 'udp port 67 or udp port 68'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
11:24:27.934542 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 576)&lt;br /&gt;
    0.0.0.0.bootpc &amp;gt; 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:aa:56:6d:ab:2f, length 548, xid 0xe854ff12, Flags [none] (0x0000)&lt;br /&gt;
	  Client-Ethernet-Address 40:aa:56:6d:ab:2f&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: Discover&lt;br /&gt;
	    Client-ID Option 61, length 7: ether 40:aa:56:6d:ab:2f&lt;br /&gt;
	    Vendor-Class Option 60, length 15: &amp;quot;udhcp 0.9.9-pre&amp;quot;&lt;br /&gt;
	    Parameter-Request Option 55, length 9: &lt;br /&gt;
	      Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname&lt;br /&gt;
	      Domain-Name, BR, YD, YS&lt;br /&gt;
	      NTP&lt;br /&gt;
	    END Option 255, length 0&lt;br /&gt;
	    PAD Option 0, length 0, occurs 267&lt;br /&gt;
11:24:27.934981 IP (tos 0xc0, ttl 64, id 53573, offset 0, flags [none], proto UDP (17), length 349)&lt;br /&gt;
    192.168.0.1.bootps &amp;gt; 192.168.15.227.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 321, xid 0xe854ff12, Flags [none] (0x0000)&lt;br /&gt;
	  Your-IP 192.168.15.227&lt;br /&gt;
	  Server-IP 192.168.0.1&lt;br /&gt;
	  Client-Ethernet-Address 40:aa:56:6d:ab:2f&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: Offer&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
	    Lease-Time Option 51, length 4: 43200&lt;br /&gt;
	    RN Option 58, length 4: 21600&lt;br /&gt;
	    RB Option 59, length 4: 37800&lt;br /&gt;
	    Domain-Name Option 15, length 19: &amp;quot;iwillfearnoevil.com&amp;quot;&lt;br /&gt;
	    Domain-Name-Server Option 6, length 12: 192.168.0.1,8.8.8.8,1.1.1.1&lt;br /&gt;
	    Default-Gateway Option 3, length 4: 192.168.0.1&lt;br /&gt;
	    BR Option 28, length 4: 192.168.15.255&lt;br /&gt;
	    Subnet-Mask Option 1, length 4: 255.255.240.0&lt;br /&gt;
	    END Option 255, length 0&lt;br /&gt;
11:24:27.944388 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 576)&lt;br /&gt;
    0.0.0.0.bootpc &amp;gt; 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 40:aa:56:6d:ab:2f, length 548, xid 0xe854ff12, Flags [none] (0x0000)&lt;br /&gt;
	  Client-Ethernet-Address 40:aa:56:6d:ab:2f&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: Request&lt;br /&gt;
	    Client-ID Option 61, length 7: ether 40:aa:56:6d:ab:2f&lt;br /&gt;
	    Vendor-Class Option 60, length 15: &amp;quot;udhcp 0.9.9-pre&amp;quot;&lt;br /&gt;
	    Requested-IP Option 50, length 4: 192.168.15.227&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
	    Parameter-Request Option 55, length 9: &lt;br /&gt;
	      Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname&lt;br /&gt;
	      Domain-Name, BR, YD, YS&lt;br /&gt;
	      NTP&lt;br /&gt;
	    END Option 255, length 0&lt;br /&gt;
	    PAD Option 0, length 0, occurs 255&lt;br /&gt;
11:24:28.054607 IP (tos 0xc0, ttl 64, id 53663, offset 0, flags [none], proto UDP (17), length 359)&lt;br /&gt;
    192.168.0.1.bootps &amp;gt; 192.168.15.227.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 331, xid 0xe854ff12, Flags [none] (0x0000)&lt;br /&gt;
	  Your-IP 192.168.15.227&lt;br /&gt;
	  Server-IP 192.168.0.1&lt;br /&gt;
	  Client-Ethernet-Address 40:aa:56:6d:ab:2f&lt;br /&gt;
	  Vendor-rfc1048 Extensions&lt;br /&gt;
	    Magic Cookie 0x63825363&lt;br /&gt;
	    DHCP-Message Option 53, length 1: ACK&lt;br /&gt;
	    Server-ID Option 54, length 4: 192.168.0.1&lt;br /&gt;
	    Lease-Time Option 51, length 4: 43200&lt;br /&gt;
	    RN Option 58, length 4: 21600&lt;br /&gt;
	    RB Option 59, length 4: 37800&lt;br /&gt;
	    Domain-Name Option 15, length 19: &amp;quot;iwillfearnoevil.com&amp;quot;&lt;br /&gt;
	    Hostname Option 12, length 8: &amp;quot;camera01&amp;quot;&lt;br /&gt;
	    Domain-Name-Server Option 6, length 12: 192.168.0.1,8.8.8.8,1.1.1.1&lt;br /&gt;
	    Default-Gateway Option 3, length 4: 192.168.0.1&lt;br /&gt;
	    BR Option 28, length 4: 192.168.15.255&lt;br /&gt;
	    Subnet-Mask Option 1, length 4: 255.255.240.0&lt;br /&gt;
	    END Option 255, length 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tcpdump]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=694</id>
		<title>Bash-interesting-command-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=694"/>
		<updated>2026-09-01T15:03:48Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Interesting one-liners====&lt;br /&gt;
== Find all drives and ignore loop devices ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep -v &amp;quot;loop\|NAME&amp;quot; | grep &amp;quot;^[a-z]\|^[A-Z]&amp;quot; | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep disk | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue match until match is found&lt;br /&gt;
* This is using awk, and seems quite powerful as a tool&lt;br /&gt;
* found this little gem at [https://unix.stackexchange.com/questions/21076/how-to-show-lines-after-each-grep-match-until-other-specific-match Stack Exchange]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awk '/Word A/,/Word D/' filename&lt;br /&gt;
&lt;br /&gt;
/From/CONTINUE/Until/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking Openstack metadata server ==&lt;br /&gt;
* useful for routing, connections, and hanging from the server itself&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for i in {1..20}; do&lt;br /&gt;
     date;&lt;br /&gt;
     curl -sS --connect-timeout 2 --max-time 5 -o /dev/null -w 'HTTP=%{http_code} CONNECT=%{time_connect} TOTAL=%{time_total}\n' http://169.254.169.254/openstack/latest/meta_data.json;&lt;br /&gt;
     sleep 2;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove non-english directories ==&lt;br /&gt;
* change the type to f if you are looking for non-english files&lt;br /&gt;
* ALWAYS test find results before deleting, duh!&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo find . -type d -not -name &amp;quot;[a-zA-Z0-9]*&amp;quot; -exec rm -rf {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== try to make a xml2 replacement for simple XML with xmllint ==&lt;br /&gt;
Who the hell thought it was a good idea to NOT have xml2 available in both Mac and Linux?  What the hell!?!?&lt;br /&gt;
* On Mac install gawk via brew&lt;br /&gt;
* will leverage xmllint, and then stupidity ensues... WTF?&lt;br /&gt;
* never trust this in prod-ish servers without a lot of testing.  chatGPT gave this suggestion as a workaround to get the xml2 behavior.&lt;br /&gt;
* I am betting that complex xml will make this choke or turn into a pumpkin but meh, it works well enough for simple stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '&amp;lt;root&amp;gt;&amp;lt;name&amp;gt;Chris&amp;lt;/name&amp;gt;&amp;lt;/root&amp;gt;' | xmllint --format - 2&amp;gt;/dev/null | gawk '&lt;br /&gt;
  /&amp;lt;[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    tag = gensub(/.*&amp;lt;([[:alnum:]_:-]+)&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
    path = (path ? path &amp;quot;/&amp;quot; tag : &amp;quot;/&amp;quot; tag)&lt;br /&gt;
  }&lt;br /&gt;
  /&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    if ($0 ~ /&amp;lt;[[:alnum:]_:-]+&amp;gt;[^&amp;lt;]+&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/) {&lt;br /&gt;
      val = gensub(/.*&amp;lt;[[:alnum:]_:-]+&amp;gt;([^&amp;lt;]+)&amp;lt;\/[[:alnum:]_:-]+&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
      print path &amp;quot;=&amp;quot; val&lt;br /&gt;
    }&lt;br /&gt;
    sub(/\/[^/]+$/, &amp;quot;&amp;quot;, path)&lt;br /&gt;
  }'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=693</id>
		<title>Bash-interesting-command-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=693"/>
		<updated>2026-09-01T15:01:27Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Interesting one-liners */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Interesting one-liners====&lt;br /&gt;
== Find all drives and ignore loop devices ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep -v &amp;quot;loop\|NAME&amp;quot; | grep &amp;quot;^[a-z]\|^[A-Z]&amp;quot; | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep disk | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue match until match is found&lt;br /&gt;
* This is using awk, and seems quite powerful as a tool&lt;br /&gt;
* found this little gem at [https://unix.stackexchange.com/questions/21076/how-to-show-lines-after-each-grep-match-until-other-specific-match Stack Exchange]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awk '/Word A/,/Word D/' filename&lt;br /&gt;
&lt;br /&gt;
/From/CONTINUE/Until/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking Openstack metadata server ==&lt;br /&gt;
* useful for routing, connections, and hanging from the server itself&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for i in {1..20}; do&lt;br /&gt;
     date;&lt;br /&gt;
     curl -sS --connect-timeout 2 --max-time 5 -o /dev/null -w 'HTTP=%{http_code} CONNECT=%{time_connect} TOTAL=%{time_total}\n' http://169.254.169.254/openstack/latest/meta_data.json;&lt;br /&gt;
     sleep 2;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove non-english directories ==&lt;br /&gt;
* change the type to f if you are looking for non-english files&lt;br /&gt;
* ALWAYS test find results before deleting, duh!&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo find . -type d -not -name &amp;quot;[a-zA-Z0-9]*&amp;quot; -exec rm -rf {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Who the hell thought it was a good idea to NOT have xml2 available in both Mac and Linux?  What the hell!?!?&lt;br /&gt;
* On Mac install gawk via brew&lt;br /&gt;
* will leverage xmllint, and then stupidity ensues... WTF?&lt;br /&gt;
* never trust this in prod-ish servers without a lot of testing.  chatGPT gave this suggestion as a workaround to get the xml2 behavior.&lt;br /&gt;
* I am betting that complex xml will make this choke or turn into a pumpkin but meh, it works well enough for simple stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '&amp;lt;root&amp;gt;&amp;lt;name&amp;gt;Chris&amp;lt;/name&amp;gt;&amp;lt;/root&amp;gt;' | xmllint --format - 2&amp;gt;/dev/null | gawk '&lt;br /&gt;
  /&amp;lt;[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    tag = gensub(/.*&amp;lt;([[:alnum:]_:-]+)&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
    path = (path ? path &amp;quot;/&amp;quot; tag : &amp;quot;/&amp;quot; tag)&lt;br /&gt;
  }&lt;br /&gt;
  /&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    if ($0 ~ /&amp;lt;[[:alnum:]_:-]+&amp;gt;[^&amp;lt;]+&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/) {&lt;br /&gt;
      val = gensub(/.*&amp;lt;[[:alnum:]_:-]+&amp;gt;([^&amp;lt;]+)&amp;lt;\/[[:alnum:]_:-]+&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
      print path &amp;quot;=&amp;quot; val&lt;br /&gt;
    }&lt;br /&gt;
    sub(/\/[^/]+$/, &amp;quot;&amp;quot;, path)&lt;br /&gt;
  }'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=692</id>
		<title>Git notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=692"/>
		<updated>2026-08-31T14:53:58Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Find branch in detached head */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== General git commands that are useful ===&lt;br /&gt;
== Change git remote:==&lt;br /&gt;
&lt;br /&gt;
With or without ssh keys added to your user account..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin git@gitlab01.iwillfearnoevil.com:monitoring/nmsui.git&lt;br /&gt;
or:&lt;br /&gt;
git remote set-url origin https://gitlab01.iwillfearnoevil.com/monitoring/nmsui.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sort git branches by last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show git commit hashes for each branch sorted by date ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=-committerdate refs/heads/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do a git diff between two branches ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git diff &amp;lt;branch&amp;gt;..origin/&amp;lt;branch2&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update Submodules ==&lt;br /&gt;
[https://stackoverflow.com/questions/1030169/pull-latest-changes-for-all-git-submodules pull-latest-changes-for-all-git-submodules]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --recursive --init&lt;br /&gt;
git submodule update --recursive --remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Checkout specific commit hash ==&lt;br /&gt;
This can be useful when the hash is not in the expected branch, or when you are in a detached head state&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone [remote_address_here] my_repo&lt;br /&gt;
cd my_repo&lt;br /&gt;
git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change submodule URL ==&lt;br /&gt;
This is very much a hammer way of doing this.  I have seen elegant ways online, but they seem inconsistent when something goes wrong.  This way is reproducible as far as I am concerned.&lt;br /&gt;
&lt;br /&gt;
This example assumes that directory/ is where your submodule lives.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
edit .gitmodule&lt;br /&gt;
change values&lt;br /&gt;
rm -rf directory/&lt;br /&gt;
git submodule update --init --recursive --remote&lt;br /&gt;
cd into directory/&lt;br /&gt;
git pull whatever submodule branch you need&lt;br /&gt;
cd ..&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'save new submodule changes'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Save image in README.md on github.com ==&lt;br /&gt;
Per: [https://stackoverflow.com/questions/14494747/how-to-add-images-to-readme-md-on-github Stackoverflow]&lt;br /&gt;
&lt;br /&gt;
Works:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Very Simple : Can be done using Ctrl + C/V&lt;br /&gt;
&lt;br /&gt;
Most of the answers here directly or indirectly involve uploading the image somewhere else &amp;amp; then providing a link to it.&lt;br /&gt;
&lt;br /&gt;
It can be done very simply by just copying any image and pasting it while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
    Copying the image - You can just click on the image file and use Ctrl + C or may copy the screenshot image to your clipboard using the snipping tool&lt;br /&gt;
    You can then simply do Ctrl + V while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
Guithub will automatically upload it to user-images.githubusercontent.com and a link to it will be inserted there&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change remote URL ==&lt;br /&gt;
[https://stackoverflow.com/questions/2432764/how-do-i-change-the-uri-url-for-a-remote-git-repository Change Git remote URL]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin new.git.url/here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ignore local changes and pull ==&lt;br /&gt;
When you simply want to start over and nuke all your local mess....&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4157189/how-to-git-pull-while-ignoring-local-changes Stackoverflow on doing this]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git fetch --all&lt;br /&gt;
git reset --hard origin/&amp;lt;branch_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clean up local orphan branches ==&lt;br /&gt;
When you have branches locally present that have been merged on the remote server this works to clean out your local repo.&lt;br /&gt;
&lt;br /&gt;
If there are still some that you want to keep, add in a 'grep -v &amp;quot;someName&amp;quot;' before xargs&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote remove tracking branches no longer on remote]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch --merged | grep -v &amp;quot;\*&amp;quot; | xargs -n 1 git branch -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Get latest commit hash for scripts ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git rev-parse HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove submodules of submodules ==&lt;br /&gt;
* This has been a recurring painful process.  This is one solution that has worked for me&lt;br /&gt;
[https://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule Stack Overflow discussion on this]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive REPO&lt;br /&gt;
cd down/to/submodule&lt;br /&gt;
git checkout branch needed&lt;br /&gt;
rm -f .gitmodules&lt;br /&gt;
git submodule -init&lt;br /&gt;
git submodule -update&lt;br /&gt;
git rm --cached file/path/with/error/message&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove submodules of submodules'&lt;br /&gt;
git push&lt;br /&gt;
cd parent repository&lt;br /&gt;
cat .gitmodules&lt;br /&gt;
Verify no references to submodules of submodules&lt;br /&gt;
git submodule status --recursive&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove references in submodule to nested submodules'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nuke a bad commit before push ==&lt;br /&gt;
* When you have saved a commit but it is not been pushed and you want to get rid of it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Keep the work done:&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&lt;br /&gt;
Destroy all work done and get last full commit&lt;br /&gt;
git reset --hard HEAD~1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drop changes and pull submodules ==&lt;br /&gt;
* When you have a submodule that is out of whack with the main repo and you cannot figure out which commit it is supposed to be at easily&lt;br /&gt;
&lt;br /&gt;
* reset --hard gets rid of all local changes&lt;br /&gt;
* clean -fdx removes untracked files and directories&lt;br /&gt;
* The submodule update resets the submodule’s HEAD to what the parent repo wants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd path/to/submodule&lt;br /&gt;
git reset --hard&lt;br /&gt;
git clean -fdx&lt;br /&gt;
cd ..&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== mis-synced between parent and submodule commits ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Find branch in detached head ==&lt;br /&gt;
[https://stackoverflow.com/questions/6059336/how-to-find-the-current-git-branch-in-detached-head-state | Find branch in detached head]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git show-ref | grep $(git log --pretty=%h -1) | sed 's|.*/\(.*\)|\1|' | sort -u | grep -v HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pull a branch util mirroring updates ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
STAT=&amp;quot;Already up&amp;quot;; while [[ ${STAT} =~ &amp;quot;Already up&amp;quot; ]]; do STAT=$(git pull) ; echo -n &amp;quot;$(date) ${STAT}&amp;quot; ; echo &amp;quot;&amp;quot; ; sleep&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Openstack&amp;diff=691</id>
		<title>Openstack</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Openstack&amp;diff=691"/>
		<updated>2026-06-17T17:55:21Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;== Openstack Notes and Examples ==  Find the subnets of the Floating IP addresses via loop * chatGPT derived * Note the sed to strip out the python style list result &amp;lt;pre&amp;gt; for NET in $(openstack network list --external -f value -c ID); do   echo &amp;quot;Network: $(openstack network show &amp;quot;$NET&amp;quot; -f value -c name)&amp;quot;    openstack network show &amp;quot;$NET&amp;quot; -f value -c subnets |     sed &amp;quot;s/[][]//g; s/'//g; s/, /\n/g&amp;quot; |     while read -r SUBNET; do       openstack subnet show &amp;quot;$SUBNET&amp;quot; -f va...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Openstack Notes and Examples ==&lt;br /&gt;
&lt;br /&gt;
Find the subnets of the Floating IP addresses via loop&lt;br /&gt;
* chatGPT derived&lt;br /&gt;
* Note the sed to strip out the python style list result&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for NET in $(openstack network list --external -f value -c ID); do&lt;br /&gt;
  echo &amp;quot;Network: $(openstack network show &amp;quot;$NET&amp;quot; -f value -c name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  openstack network show &amp;quot;$NET&amp;quot; -f value -c subnets |&lt;br /&gt;
    sed &amp;quot;s/[][]//g; s/'//g; s/, /\n/g&amp;quot; |&lt;br /&gt;
    while read -r SUBNET; do&lt;br /&gt;
      openstack subnet show &amp;quot;$SUBNET&amp;quot; -f value -c name -c cidr -c allocation_pools&lt;br /&gt;
    done&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Openstack]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-jq-examples&amp;diff=690</id>
		<title>Bash-jq-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-jq-examples&amp;diff=690"/>
		<updated>2026-06-12T22:02:23Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Convert JSON to bash variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Examples of using jq to parse output for use in a bash script.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
== Some examples of using jq to do filtering.. ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
raw jason:&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;1&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;id&amp;quot;: &amp;quot;123456789&amp;quot;,&lt;br /&gt;
      &amp;quot;accountId&amp;quot;: &amp;quot;a1-supplies-01234&amp;quot;,&lt;br /&gt;
      &amp;quot;accountName&amp;quot;: &amp;quot;a1-supplies&amp;quot;,&lt;br /&gt;
      &amp;quot;status&amp;quot;: &amp;quot;LIVE&amp;quot;,&lt;br /&gt;
      &amp;quot;customerId&amp;quot;: &amp;quot;A1 Supplies&amp;quot;,&lt;br /&gt;
      &amp;quot;customerType&amp;quot;: &amp;quot;display&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
Map will iterate through the array(s) looking for key status, and value LIVE&lt;br /&gt;
&amp;lt;json here&amp;gt; | jq  -c 'map(select(.[].status | contains (&amp;quot;LIVE&amp;quot;)))' | jq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Running the output through jq again puts the line breaks back in place&lt;br /&gt;
&lt;br /&gt;
* contains in a search DOES honor pipes&lt;br /&gt;
&amp;lt;pre&amp;gt; contains (&amp;quot;LIVE&amp;quot;|&amp;quot;DEAD&amp;quot;) &amp;lt;/pre&amp;gt;&lt;br /&gt;
[https://stackoverflow.com/questions/26701538/how-to-filter-an-array-of-objects-based-on-values-in-an-inner-array-with-jq| Stackoverflow details]&lt;br /&gt;
&lt;br /&gt;
== Return the array where a value matches ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /tmp/APP_JSON  | jq '.system_env_json.someService.[].[] | select (.name == &amp;quot;foobar&amp;quot;)'&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;label&amp;quot;: &amp;quot;generic-name&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;tags&amp;quot;: [],&lt;br /&gt;
  &amp;quot;instance_guid&amp;quot;: &amp;quot;64fcbaba-3684-4435-b50a-adaa7fc9c2&amp;quot;,&lt;br /&gt;
  &amp;quot;instance_name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;binding_guid&amp;quot;: &amp;quot;5e4c8-6c7-420-9f18f-8f8df52&amp;quot;,&lt;br /&gt;
  &amp;quot;binding_name&amp;quot;: null,&lt;br /&gt;
  &amp;quot;credentials&amp;quot;: {&lt;br /&gt;
    &amp;quot;apitoken&amp;quot;: &amp;quot;some token&amp;quot;,&lt;br /&gt;
    &amp;quot;apiurl&amp;quot;: &amp;quot;https://api.iwillfearnoevil.com/e/82542d-4820-8b5-e032dbc66/api&amp;quot;,&lt;br /&gt;
    &amp;quot;environmentid&amp;quot;: &amp;quot;something&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;syslog_drain_url&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;volume_mounts&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Another way to filter down to what you are searching for ==&lt;br /&gt;
* TBH, this one feels like simply abusing jq until it pukes up what you asked for&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JSON_FILE=$1&lt;br /&gt;
&lt;br /&gt;
jq ' .system_env_json.someService | paths(select(. != null and type == &amp;quot;object&amp;quot; and has(&amp;quot;credential-type&amp;quot;))) as $p |&lt;br /&gt;
    {&lt;br /&gt;
        name: getpath($p[:-1] + [&amp;quot;name&amp;quot;]),&lt;br /&gt;
        path: $p | join(&amp;quot;.&amp;quot;),&lt;br /&gt;
        credentials: getpath($p)&lt;br /&gt;
    }' &amp;lt; &amp;quot;$JSON_FILE&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Filter for two values in JSON ==&lt;br /&gt;
This has externalHostname at the beginning of the index, and then upTime maps down to the index under property which is a name: value pair&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /tmp/foo | jq '.[] | {externalHostName, upTime: (.tags.property[] | select(.name == &amp;quot;up.time&amp;quot;).value)}'&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;externalHostName&amp;quot;: &amp;quot;server01.fqdn.com&amp;quot;,&lt;br /&gt;
  &amp;quot;upTime&amp;quot;: &amp;quot;54 minutes 37 seconds&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;externalHostName&amp;quot;: &amp;quot;server02.fqdn.com&amp;quot;,&lt;br /&gt;
  &amp;quot;upTime&amp;quot;: &amp;quot;5 days 19 hours 59 minutes 9 seconds&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Convert JSON to bash variables ==&lt;br /&gt;
This is for simple JSON only.  Convert raw json into export variables&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jq -r 'to_entries[] | &amp;quot;export \(.key)=\&amp;quot;\(.value)\&amp;quot;&amp;quot;' simpleJson.json &amp;gt; exportConfig.env&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat simpleJson.json&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat exportConfig.env&lt;br /&gt;
export foo=&amp;quot;bar&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-jq-examples&amp;diff=689</id>
		<title>Bash-jq-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-jq-examples&amp;diff=689"/>
		<updated>2026-06-12T22:00:49Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Filter for two values in JSON */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Examples of using jq to parse output for use in a bash script.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
== Some examples of using jq to do filtering.. ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
raw jason:&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;1&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;id&amp;quot;: &amp;quot;123456789&amp;quot;,&lt;br /&gt;
      &amp;quot;accountId&amp;quot;: &amp;quot;a1-supplies-01234&amp;quot;,&lt;br /&gt;
      &amp;quot;accountName&amp;quot;: &amp;quot;a1-supplies&amp;quot;,&lt;br /&gt;
      &amp;quot;status&amp;quot;: &amp;quot;LIVE&amp;quot;,&lt;br /&gt;
      &amp;quot;customerId&amp;quot;: &amp;quot;A1 Supplies&amp;quot;,&lt;br /&gt;
      &amp;quot;customerType&amp;quot;: &amp;quot;display&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
Map will iterate through the array(s) looking for key status, and value LIVE&lt;br /&gt;
&amp;lt;json here&amp;gt; | jq  -c 'map(select(.[].status | contains (&amp;quot;LIVE&amp;quot;)))' | jq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Running the output through jq again puts the line breaks back in place&lt;br /&gt;
&lt;br /&gt;
* contains in a search DOES honor pipes&lt;br /&gt;
&amp;lt;pre&amp;gt; contains (&amp;quot;LIVE&amp;quot;|&amp;quot;DEAD&amp;quot;) &amp;lt;/pre&amp;gt;&lt;br /&gt;
[https://stackoverflow.com/questions/26701538/how-to-filter-an-array-of-objects-based-on-values-in-an-inner-array-with-jq| Stackoverflow details]&lt;br /&gt;
&lt;br /&gt;
== Return the array where a value matches ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /tmp/APP_JSON  | jq '.system_env_json.someService.[].[] | select (.name == &amp;quot;foobar&amp;quot;)'&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;label&amp;quot;: &amp;quot;generic-name&amp;quot;,&lt;br /&gt;
  &amp;quot;name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;tags&amp;quot;: [],&lt;br /&gt;
  &amp;quot;instance_guid&amp;quot;: &amp;quot;64fcbaba-3684-4435-b50a-adaa7fc9c2&amp;quot;,&lt;br /&gt;
  &amp;quot;instance_name&amp;quot;: &amp;quot;foobar&amp;quot;,&lt;br /&gt;
  &amp;quot;binding_guid&amp;quot;: &amp;quot;5e4c8-6c7-420-9f18f-8f8df52&amp;quot;,&lt;br /&gt;
  &amp;quot;binding_name&amp;quot;: null,&lt;br /&gt;
  &amp;quot;credentials&amp;quot;: {&lt;br /&gt;
    &amp;quot;apitoken&amp;quot;: &amp;quot;some token&amp;quot;,&lt;br /&gt;
    &amp;quot;apiurl&amp;quot;: &amp;quot;https://api.iwillfearnoevil.com/e/82542d-4820-8b5-e032dbc66/api&amp;quot;,&lt;br /&gt;
    &amp;quot;environmentid&amp;quot;: &amp;quot;something&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;syslog_drain_url&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;volume_mounts&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Another way to filter down to what you are searching for ==&lt;br /&gt;
* TBH, this one feels like simply abusing jq until it pukes up what you asked for&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JSON_FILE=$1&lt;br /&gt;
&lt;br /&gt;
jq ' .system_env_json.someService | paths(select(. != null and type == &amp;quot;object&amp;quot; and has(&amp;quot;credential-type&amp;quot;))) as $p |&lt;br /&gt;
    {&lt;br /&gt;
        name: getpath($p[:-1] + [&amp;quot;name&amp;quot;]),&lt;br /&gt;
        path: $p | join(&amp;quot;.&amp;quot;),&lt;br /&gt;
        credentials: getpath($p)&lt;br /&gt;
    }' &amp;lt; &amp;quot;$JSON_FILE&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Filter for two values in JSON ==&lt;br /&gt;
This has externalHostname at the beginning of the index, and then upTime maps down to the index under property which is a name: value pair&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /tmp/foo | jq '.[] | {externalHostName, upTime: (.tags.property[] | select(.name == &amp;quot;up.time&amp;quot;).value)}'&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;externalHostName&amp;quot;: &amp;quot;server01.fqdn.com&amp;quot;,&lt;br /&gt;
  &amp;quot;upTime&amp;quot;: &amp;quot;54 minutes 37 seconds&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;externalHostName&amp;quot;: &amp;quot;server02.fqdn.com&amp;quot;,&lt;br /&gt;
  &amp;quot;upTime&amp;quot;: &amp;quot;5 days 19 hours 59 minutes 9 seconds&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Convert JSON to bash variables ==&lt;br /&gt;
This is for simple JSON only.  Convert raw json into export variables&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
jq -r 'to_entries[] | &amp;quot;export \(.key)=\&amp;quot;\(.value)\&amp;quot;&amp;quot;' simpleJson.json &amp;gt; exportConfig.env&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=688</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=688"/>
		<updated>2026-02-11T17:34:15Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 02-10-26&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Work has been taking up a lot of time.  Slow progress on UI updates.&lt;br /&gt;
* Minor bugfixes on API&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-28-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Updating the polling system is taking much longer than I expected to really support independent polling.  Will continue focusing on this.&lt;br /&gt;
* might goof off on the UI and continue the more fun conversion to the dark / light mode support changes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* I am still cleaning the UX for dark and light mode in the dev branch.  Running behind on merging to main.&lt;br /&gt;
* Refactoring the Polling system to better support remote pollers out of the box&lt;br /&gt;
* Set base rules that host specific always overrides host or device groups for monitor checks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash_sed&amp;diff=687</id>
		<title>Bash sed</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash_sed&amp;diff=687"/>
		<updated>2025-12-30T17:44:10Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Inline commenting by line range */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Useful sed commands ====&lt;br /&gt;
&lt;br /&gt;
== Ignore until EOF ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat foo | sed &amp;quot;1,/^stringMatch/d&amp;quot;&lt;br /&gt;
* Will ignore all before string match until EOF&lt;br /&gt;
* stringMatch must be start of line (^)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Match all until EOF ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat foo | sed &amp;quot;/^stringMatch2/q&amp;quot; | grep -v &amp;quot;^stringMatch2&amp;quot;&lt;br /&gt;
* will match ALL until match ( and remove match string LINE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Strip pattern match ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;192.168.15.58 172.17.0.1 123.10.130.201&amp;quot; | sed 's/172.[[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+//'&lt;br /&gt;
192.168.15.58  123.10.130.201&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Will strip out IP addresses beginning with 172.&lt;br /&gt;
&lt;br /&gt;
== Replace in file only when matching regex ==&lt;br /&gt;
This will only alter values if the first arg matches&lt;br /&gt;
Nice for changing values in a script or ini&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed -ie '/^foo/s/4/20/g' /tmp/b&lt;br /&gt;
&lt;br /&gt;
cat /tmp/b&lt;br /&gt;
foo=20&lt;br /&gt;
 foo=4&lt;br /&gt;
bar=5&lt;br /&gt;
 bar=5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Strip leading and trailing whitespace ==&lt;br /&gt;
I like this a little better than the awk version which is shorter.  However this makes sense in my head.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
| sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inline commenting by line range ==&lt;br /&gt;
This is an interesting one.  I needed to add the # character from line 483 until 828 but still keep the data.  This sed was one I had never used but will need to remember.. Very useful&lt;br /&gt;
&lt;br /&gt;
It did successfully comment out all the lines without breaking stuff.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed '483,828 s/^/#/' clean_me.yml &amp;gt; filteredCleanFile.yml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash_sed&amp;diff=686</id>
		<title>Bash sed</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash_sed&amp;diff=686"/>
		<updated>2025-12-30T17:43:20Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Strip leading and trailing whitespace */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Useful sed commands ====&lt;br /&gt;
&lt;br /&gt;
== Ignore until EOF ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat foo | sed &amp;quot;1,/^stringMatch/d&amp;quot;&lt;br /&gt;
* Will ignore all before string match until EOF&lt;br /&gt;
* stringMatch must be start of line (^)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Match all until EOF ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat foo | sed &amp;quot;/^stringMatch2/q&amp;quot; | grep -v &amp;quot;^stringMatch2&amp;quot;&lt;br /&gt;
* will match ALL until match ( and remove match string LINE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Strip pattern match ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;192.168.15.58 172.17.0.1 123.10.130.201&amp;quot; | sed 's/172.[[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+//'&lt;br /&gt;
192.168.15.58  123.10.130.201&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Will strip out IP addresses beginning with 172.&lt;br /&gt;
&lt;br /&gt;
== Replace in file only when matching regex ==&lt;br /&gt;
This will only alter values if the first arg matches&lt;br /&gt;
Nice for changing values in a script or ini&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed -ie '/^foo/s/4/20/g' /tmp/b&lt;br /&gt;
&lt;br /&gt;
cat /tmp/b&lt;br /&gt;
foo=20&lt;br /&gt;
 foo=4&lt;br /&gt;
bar=5&lt;br /&gt;
 bar=5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Strip leading and trailing whitespace ==&lt;br /&gt;
I like this a little better than the awk version which is shorter.  However this makes sense in my head.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
| sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inline commenting by line range ==&lt;br /&gt;
This is an interesting one.  I needed to add the # character from line 483 until 828 but still keep the data.  This sed was one I had never used but will need to remember.. Very useful&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed '483,828 s/^/#/' clean_me.yml &amp;gt; filteredCleanFile.yml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=685</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=685"/>
		<updated>2025-10-28T16:32:42Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-28-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Updating the polling system is taking much longer than I expected to really support independent polling.  Will continue focusing on this.&lt;br /&gt;
* might goof off on the UI and continue the more fun conversion to the dark / light mode support changes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* I am still cleaning the UX for dark and light mode in the dev branch.  Running behind on merging to main.&lt;br /&gt;
* Refactoring the Polling system to better support remote pollers out of the box&lt;br /&gt;
* Set base rules that host specific always overrides host or device groups for monitor checks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=684</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=684"/>
		<updated>2025-10-28T15:23:01Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-28&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Updating the polling system is taking much longer than I expected to really support independent polling.  Will continue focusing on this.&lt;br /&gt;
* might goof off on the UI and continue the more fun conversion to the dark / light mode support changes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* I am still cleaning the UX for dark and light mode in the dev branch.  Running behind on merging to main.&lt;br /&gt;
* Refactoring the Polling system to better support remote pollers out of the box&lt;br /&gt;
* Set base rules that host specific always overrides host or device groups for monitor checks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=683</id>
		<title>Bash-interesting-command-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-interesting-command-examples&amp;diff=683"/>
		<updated>2025-10-28T15:21:07Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====Interesting one-liners====&lt;br /&gt;
* Find all drives and ignore loop devices&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep -v &amp;quot;loop\|NAME&amp;quot; | grep &amp;quot;^[a-z]\|^[A-Z]&amp;quot; | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@kvm03:/var/log# lsblk | grep disk | awk '{print $1}'&lt;br /&gt;
sda&lt;br /&gt;
sdb&lt;br /&gt;
root@kvm03:/var/log# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Continue match until match is found&lt;br /&gt;
* This is using awk, and seems quite powerful as a tool&lt;br /&gt;
* found this little gem at [https://unix.stackexchange.com/questions/21076/how-to-show-lines-after-each-grep-match-until-other-specific-match Stack Exchange]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awk '/Word A/,/Word D/' filename&lt;br /&gt;
&lt;br /&gt;
/From/CONTINUE/Until/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Remove non-english directories&lt;br /&gt;
* change the type to f if you are looking for non-english files&lt;br /&gt;
* ALWAYS test find results before deleting, duh!&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo find . -type d -not -name &amp;quot;[a-zA-Z0-9]*&amp;quot; -exec rm -rf {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Who the hell thought it was a good idea to NOT have xml2 available in both Mac and Linux?  What the hell!?!?&lt;br /&gt;
* On Mac install gawk via brew&lt;br /&gt;
* will leverage xmllint, and then stupidity ensues... WTF?&lt;br /&gt;
* never trust this in prod-ish servers without a lot of testing.  chatGPT gave this suggestion as a workaround to get the xml2 behavior.&lt;br /&gt;
* I am betting that complex xml will make this choke or turn into a pumpkin but meh, it works well enough for simple stuff.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '&amp;lt;root&amp;gt;&amp;lt;name&amp;gt;Chris&amp;lt;/name&amp;gt;&amp;lt;/root&amp;gt;' | xmllint --format - 2&amp;gt;/dev/null | gawk '&lt;br /&gt;
  /&amp;lt;[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    tag = gensub(/.*&amp;lt;([[:alnum:]_:-]+)&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
    path = (path ? path &amp;quot;/&amp;quot; tag : &amp;quot;/&amp;quot; tag)&lt;br /&gt;
  }&lt;br /&gt;
  /&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/ {&lt;br /&gt;
    if ($0 ~ /&amp;lt;[[:alnum:]_:-]+&amp;gt;[^&amp;lt;]+&amp;lt;\/[[:alnum:]_:-]+&amp;gt;/) {&lt;br /&gt;
      val = gensub(/.*&amp;lt;[[:alnum:]_:-]+&amp;gt;([^&amp;lt;]+)&amp;lt;\/[[:alnum:]_:-]+&amp;gt;.*/, &amp;quot;\\1&amp;quot;, &amp;quot;g&amp;quot;)&lt;br /&gt;
      print path &amp;quot;=&amp;quot; val&lt;br /&gt;
    }&lt;br /&gt;
    sub(/\/[^/]+$/, &amp;quot;&amp;quot;, path)&lt;br /&gt;
  }'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=682</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=682"/>
		<updated>2025-10-13T18:49:33Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* I am still cleaning the UX for dark and light mode in the dev branch.  Running behind on merging to main.&lt;br /&gt;
* Refactoring the Polling system to better support remote pollers out of the box&lt;br /&gt;
* Set base rules that host specific always overrides host or device groups for monitor checks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=681</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=681"/>
		<updated>2025-10-13T18:49:14Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* I am still cleaning the UX for dark and light mode in the dev branch.  Running behind on merging to main.&lt;br /&gt;
* Refactoring the Polling system to better support remote pollers out of the box&lt;br /&gt;
* Set base rules that host specific always overrides host or device groups for monitor checks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=680</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=680"/>
		<updated>2025-09-09T16:50:44Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 09-08-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Working on the dashboard UX.  Have something I am not embarrassed about.  Now need to wire it in and get that format standard..  Hope to merge into main branch in a week or two&lt;br /&gt;
* Couple of new API routes setup for the dashboard to get summary data and hotspot information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Mediawiki&amp;diff=679</id>
		<title>Category:Mediawiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Mediawiki&amp;diff=679"/>
		<updated>2025-08-27T17:19:49Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;Simply anything that is specific to Mediawiki that I have had to do over time or things I learned.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Simply anything that is specific to Mediawiki that I have had to do over time or things I learned.&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Mediawiki&amp;diff=678</id>
		<title>Mediawiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Mediawiki&amp;diff=678"/>
		<updated>2025-08-27T17:08:22Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:mediawiki]]&lt;br /&gt;
===Mediawiki Notes===&lt;br /&gt;
General tasks done over time to maintain mediawiki.&lt;br /&gt;
&lt;br /&gt;
==Nuke SPAM accounts==&lt;br /&gt;
Login to the MySQL database to do this work..&lt;br /&gt;
* Spaamers are adding bot email address into notes, so we can use that as a better filter&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UPDATE account_requests SET   acr_deleted = 1,   acr_rejected = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'),   acr_comment = 'Mass rejection due to account bot or spammer abuse' WHERE acr_deleted = 0 AND acr_email = acr_notes;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* This is the old version.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UPDATE account_requests SET   acr_deleted = 1,   acr_rejected = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'),   acr_comment = 'Mass rejection due to account abuse spike' WHERE acr_deleted = 0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Attempt indexing==&lt;br /&gt;
* TBD&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Mediawiki&amp;diff=677</id>
		<title>Mediawiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Mediawiki&amp;diff=677"/>
		<updated>2025-08-27T17:03:48Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;Category:mediawiki ===Mediawiki Notes=== General tasks done over time to maintain mediawiki.  ==Nuke SPAM accounts== Login to the MySQL database to do this work.. * UPDATE account_requests SET   acr_deleted = 1,   acr_rejected = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'),   acr_comment = 'Mass rejection due to account bot or spammer abuse' WHERE acr_deleted = 0 AND acr_email = acr_notes;  ==Attempt indexing== * TBD&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:mediawiki]]&lt;br /&gt;
===Mediawiki Notes===&lt;br /&gt;
General tasks done over time to maintain mediawiki.&lt;br /&gt;
&lt;br /&gt;
==Nuke SPAM accounts==&lt;br /&gt;
Login to the MySQL database to do this work..&lt;br /&gt;
* UPDATE account_requests SET   acr_deleted = 1,   acr_rejected = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s'),   acr_comment = 'Mass rejection due to account bot or spammer abuse' WHERE acr_deleted = 0 AND acr_email = acr_notes;&lt;br /&gt;
&lt;br /&gt;
==Attempt indexing==&lt;br /&gt;
* TBD&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-sorting-apache&amp;diff=676</id>
		<title>Bash-sorting-apache</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-sorting-apache&amp;diff=676"/>
		<updated>2025-08-27T16:58:35Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:bash]][[Category:fail2ban]]&lt;br /&gt;
Example of how to sort a logfile for top hits (apache in this case)&lt;br /&gt;
&lt;br /&gt;
Why is this useful?  Think making a case statement and stuff that is a script kiddie attack gets auto-blocked via fail2ban.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
awk '$9 == &amp;quot;404&amp;quot; {print $7}' access.log |sort|uniq -c|sort -rn| head -n 30&lt;br /&gt;
Bonus: do this for nginx logs now :P&lt;br /&gt;
SRC: https://twitter.com/climagic/status/1448297516571762691&lt;br /&gt;
&lt;br /&gt;
Something like this could be used to further update fail2ban-flies&lt;br /&gt;
&lt;br /&gt;
Returned:&lt;br /&gt;
      7 /.env&lt;br /&gt;
      6 /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application&lt;br /&gt;
      5 /GponForm/diag_Form?style/&lt;br /&gt;
      3 /owa/auth/x.js&lt;br /&gt;
      3 /owa/auth/logon.aspx?url=https%3a%2f%2f1%2fecp%2f&lt;br /&gt;
      3 /owa/auth/logon.aspx&lt;br /&gt;
      3 /actuator/health&lt;br /&gt;
      2 /wp-includes/js/jquery/jquery.js&lt;br /&gt;
      2 /vendor/phpunit/phpunit/build.xml&lt;br /&gt;
      2 /plugins/system/debug/debug.xml&lt;br /&gt;
      2 /OA_HTML/AppsLocalLogin.jsp&lt;br /&gt;
      2 /nice%20ports%2C/Tri%6Eity.txt%2ebak&lt;br /&gt;
      2 /misc/ajax.js&lt;br /&gt;
      2 /login&lt;br /&gt;
      2 /js/header-rollup-554.js&lt;br /&gt;
      2 /images/editor/separator.gif&lt;br /&gt;
      2 /.git/config&lt;br /&gt;
      2 /fckeditor/editor/filemanager/connectors/php/upload.php?Type=Media&lt;br /&gt;
      2 /admin/view/javascript/common.js&lt;br /&gt;
      2 /administrator/language/en-GB/install.xml&lt;br /&gt;
      2 /administrator/help/en-GB/toc.json&lt;br /&gt;
      2 /administrator/&lt;br /&gt;
      2 /admin/includes/general.js&lt;br /&gt;
      2 /aab9&lt;br /&gt;
      2 /aaa9&lt;br /&gt;
      1 /xmrlpc.php?daksldlkdsadas=1&lt;br /&gt;
      1 /wp-login.php&lt;br /&gt;
      1 /wp-includes/css/buttons.css&lt;br /&gt;
      1 /.well-known/security.txt&lt;br /&gt;
      1 /ucmdb-api/connect&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Iptables&amp;diff=675</id>
		<title>Iptables</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Iptables&amp;diff=675"/>
		<updated>2025-08-27T16:57:40Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==iptables notes==&lt;br /&gt;
Just some generic notes on working with IP tables.  Can be a PITA when an issue is happening to remember the details..&lt;br /&gt;
&lt;br /&gt;
REMEMBER:  You can block YOURSELF if you do not use your head!&lt;br /&gt;
&lt;br /&gt;
Dont block:&lt;br /&gt;
* Internal IP address&lt;br /&gt;
* YOURSELF external IP address (if logging in via public interfaces)&lt;br /&gt;
* Loopbacks...  Not sure what would happen but expect it would brick things..&lt;br /&gt;
&lt;br /&gt;
Simple blocks&lt;br /&gt;
* iptables -A INPUT -s 47.245.124.200 -j DROP&lt;br /&gt;
&lt;br /&gt;
Reminders:&lt;br /&gt;
* This will not persist across reboots&lt;br /&gt;
* setup of fail2ban would be a heck of a lot easier than manual blocking&lt;br /&gt;
* iptables -L -n is your friend&lt;br /&gt;
&lt;br /&gt;
[[Category:fail2ban]][[Category:iptables]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Fail2ban&amp;diff=674</id>
		<title>Category:Fail2ban</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Fail2ban&amp;diff=674"/>
		<updated>2025-08-27T16:56:27Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;Anything related to fail2ban can be added to this category&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Anything related to fail2ban can be added to this category&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Fail2ban&amp;diff=673</id>
		<title>Fail2ban</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Fail2ban&amp;diff=673"/>
		<updated>2025-08-27T16:56:08Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;===Fail2ban Notes=== There are a whole bunch of options and commands that I forget for fail2ban.  This is simply a list of things that can be done..  ==Ban IP== * sudo  fail2ban-client set JAIL banip 107.175.27.212  ==Status Jail== * sudo fail2ban-client status  ==UnBan IP== * sudo  fail2ban-client set JAIL unbanip 192.168.0.1  ==Testing Regex== * fail2ban-regex /var/log/haproxy.log 'haproxy(?:\[\d+\])?: &amp;lt;HOST&amp;gt;:\d+ \[.*\] default_ssl_http_in~ wiki/wiki01 .* &amp;quot;GET /mediawi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Fail2ban Notes===&lt;br /&gt;
There are a whole bunch of options and commands that I forget for fail2ban.  This is simply a list of things that can be done..&lt;br /&gt;
&lt;br /&gt;
==Ban IP==&lt;br /&gt;
* sudo  fail2ban-client set JAIL banip 107.175.27.212&lt;br /&gt;
&lt;br /&gt;
==Status Jail==&lt;br /&gt;
* sudo fail2ban-client status&lt;br /&gt;
&lt;br /&gt;
==UnBan IP==&lt;br /&gt;
* sudo  fail2ban-client set JAIL unbanip 192.168.0.1&lt;br /&gt;
&lt;br /&gt;
==Testing Regex==&lt;br /&gt;
* fail2ban-regex /var/log/haproxy.log 'haproxy(?:\[\d+\])?: &amp;lt;HOST&amp;gt;:\d+ \[.*\] default_ssl_http_in~ wiki/wiki01 .* &amp;quot;GET /mediawiki/index\.php\?title.*.RequestAccount.*$'&lt;br /&gt;
&lt;br /&gt;
==Ban Loops==&lt;br /&gt;
* for x in `grep mediawiki haproxy.log | grep -v 192.168.0.1 | grep Special | awk '{print $6}' | sed 's/:.*//g' | sort | uniq`;  do fail2ban-client set recidive banip $x ; done&lt;br /&gt;
&lt;br /&gt;
[[Category:fail2ban]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=672</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=672"/>
		<updated>2025-08-15T21:14:02Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Getting an account here...&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Anyone requesting an account from me DIRECTLY can have an account.&lt;br /&gt;
* The account request PAGE is being hammered by spammers and AI bots. ( so dont bother using it )&lt;br /&gt;
* It is not hard to find my personal email address, however I am not posting directly here to keep jerks from hitting me directly&lt;br /&gt;
* &amp;lt;strong&amp;gt;Anyone who DOES use the account request page ends up in fail2ban for at least 30 days. (sick of bots)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=671</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=671"/>
		<updated>2025-08-13T17:16:09Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
* Looking at refactor of defined monitor association with hosts.  Right now it is clunky and not flexible for one offs per host&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=670</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=670"/>
		<updated>2025-08-13T17:15:24Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More UX work and seeing if I can improve the poller daemon a bit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=669</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=669"/>
		<updated>2025-07-30T19:09:11Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-30-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* More making the frontend pretty.  I am really not AS embarrassed as I was.&lt;br /&gt;
* investigating breakout of array of monitors to allow for unique checks from the defined monitors.  Every monitor being the same across all hosts is causing some issues.  We need to be able to say &amp;quot;host1 needs value2&amp;quot; and &amp;quot;host2 needs value6&amp;quot; for the same service check.&lt;br /&gt;
* Still need to update the screenshots in the git repos to reflect the better looking UI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=668</id>
		<title>Url encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=668"/>
		<updated>2025-07-10T17:29:04Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* URL encoding function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==URL encoding function==&lt;br /&gt;
* Simple way to encode URLs for bash scripts..  Brainless but seems to work ok for most use cases..&lt;br /&gt;
* Yes, this will encode the '/' as the '%2F' character, but curl does not spit errors and I have not seen a failure doing things this way&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urlencode() {&lt;br /&gt;
  local string=&amp;quot;$1&amp;quot;&lt;br /&gt;
  local encoded=&amp;quot;&amp;quot;&lt;br /&gt;
  local pos c o&lt;br /&gt;
  for (( pos=0 ; pos&amp;lt;${#string} ; pos++ )); do&lt;br /&gt;
    c=${string:$pos:1}&lt;br /&gt;
    case &amp;quot;$c&amp;quot; in&lt;br /&gt;
      [a-zA-Z0-9.~_-]) o=&amp;quot;$c&amp;quot; ;;&lt;br /&gt;
      *) printf -v o '%%%02X' &amp;quot;'$c&amp;quot;&lt;br /&gt;
    esac&lt;br /&gt;
    encoded+=&amp;quot;$o&amp;quot;&lt;br /&gt;
  done&lt;br /&gt;
  echo &amp;quot;$encoded&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=667</id>
		<title>Url encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=667"/>
		<updated>2025-07-10T17:28:26Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* URL encoding function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==URL encoding function==&lt;br /&gt;
* Simple way to encode URLs for bash scripts..  Brainless but seems to work ok for most use cases..&lt;br /&gt;
* Yes, this will encode the '/' character, but curl does not spit errors and I have not seen a failure doing things this way&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urlencode() {&lt;br /&gt;
  local string=&amp;quot;$1&amp;quot;&lt;br /&gt;
  local encoded=&amp;quot;&amp;quot;&lt;br /&gt;
  local pos c o&lt;br /&gt;
  for (( pos=0 ; pos&amp;lt;${#string} ; pos++ )); do&lt;br /&gt;
    c=${string:$pos:1}&lt;br /&gt;
    case &amp;quot;$c&amp;quot; in&lt;br /&gt;
      [a-zA-Z0-9.~_-]) o=&amp;quot;$c&amp;quot; ;;&lt;br /&gt;
      *) printf -v o '%%%02X' &amp;quot;'$c&amp;quot;&lt;br /&gt;
    esac&lt;br /&gt;
    encoded+=&amp;quot;$o&amp;quot;&lt;br /&gt;
  done&lt;br /&gt;
  echo &amp;quot;$encoded&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=666</id>
		<title>Url encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Url_encode&amp;diff=666"/>
		<updated>2025-07-10T17:26:31Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;==URL encoding function== * Simple way to encode URLs for bash scripts..  Brainless but seems to work ok for most use cases.. &amp;lt;pre&amp;gt; urlencode() {   local string=&amp;quot;$1&amp;quot;   local encoded=&amp;quot;&amp;quot;   local pos c o   for (( pos=0 ; pos&amp;lt;${#string} ; pos++ )); do     c=${string:$pos:1}     case &amp;quot;$c&amp;quot; in       [a-zA-Z0-9.~_-]) o=&amp;quot;$c&amp;quot; ;;       *) printf -v o '%%%02X' &amp;quot;'$c&amp;quot;     esac     encoded+=&amp;quot;$o&amp;quot;   done   echo &amp;quot;$encoded&amp;quot; } &amp;lt;/pre&amp;gt;    Category:Bash&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==URL encoding function==&lt;br /&gt;
* Simple way to encode URLs for bash scripts..  Brainless but seems to work ok for most use cases..&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urlencode() {&lt;br /&gt;
  local string=&amp;quot;$1&amp;quot;&lt;br /&gt;
  local encoded=&amp;quot;&amp;quot;&lt;br /&gt;
  local pos c o&lt;br /&gt;
  for (( pos=0 ; pos&amp;lt;${#string} ; pos++ )); do&lt;br /&gt;
    c=${string:$pos:1}&lt;br /&gt;
    case &amp;quot;$c&amp;quot; in&lt;br /&gt;
      [a-zA-Z0-9.~_-]) o=&amp;quot;$c&amp;quot; ;;&lt;br /&gt;
      *) printf -v o '%%%02X' &amp;quot;'$c&amp;quot;&lt;br /&gt;
    esac&lt;br /&gt;
    encoded+=&amp;quot;$o&amp;quot;&lt;br /&gt;
  done&lt;br /&gt;
  echo &amp;quot;$encoded&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=665</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=665"/>
		<updated>2025-07-05T02:30:50Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 07-03-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Frontend variable cleanup.  Focus on devices.. It is messy and not maintainable as is.&lt;br /&gt;
* API error cleanup, specifically nulls in event modifications&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=664</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=664"/>
		<updated>2025-06-20T17:05:08Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-20-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* building more annotations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=663</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=663"/>
		<updated>2025-06-16T19:15:05Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged branch openApiAndCleanup)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=662</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=662"/>
		<updated>2025-06-12T15:54:05Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=661</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=661"/>
		<updated>2025-06-12T15:53:54Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
* &amp;lt;strong&amp;gt; The backend has been updated to use PHP 8.2 from 8.1&amp;lt;/strong&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=660</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=660"/>
		<updated>2025-06-12T15:33:38Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 06-12-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Have basic swagger UI working on API server (unmerged)&lt;br /&gt;
* building more annotations&lt;br /&gt;
* Some PHP syntax error bug squishing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=PHP_Notes_and_Examples&amp;diff=659</id>
		<title>PHP Notes and Examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=PHP_Notes_and_Examples&amp;diff=659"/>
		<updated>2025-06-11T18:05:46Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Slim4 Framework Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===PHP Notes and Examples===&lt;br /&gt;
==change Array to JSON ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$foo=json_encode($array,1);&lt;br /&gt;
echo $foo . &amp;quot;\n&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Convert a VALID JSON string to array==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$foo=json_decode($json, True);&lt;br /&gt;
print_r($foo);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example foreach loop (simple)==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
foreach ($nestedArray1 as $Array1) {&lt;br /&gt;
  do something with new array $array1[??};&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example Try Catch block==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Use Exception;&lt;br /&gt;
try {&lt;br /&gt;
  someRandoFunction;&lt;br /&gt;
}&lt;br /&gt;
catch (Exception $e) {&lt;br /&gt;
  doSomethingWhenErrorFound;&lt;br /&gt;
}&lt;br /&gt;
catch (ErrorName $e) {&lt;br /&gt;
  cryToMamma;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Checking if file or dir exists.  Starting point:==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$path_parts = pathinfo('/www/htdocs/inc/lib.inc.php');&lt;br /&gt;
&lt;br /&gt;
echo $path_parts['dirname'], &amp;quot;\n&amp;quot;;&lt;br /&gt;
echo $path_parts['basename'], &amp;quot;\n&amp;quot;;&lt;br /&gt;
echo $path_parts['extension'], &amp;quot;\n&amp;quot;;&lt;br /&gt;
echo $path_parts['filename'], &amp;quot;\n&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above example will output:&lt;br /&gt;
&lt;br /&gt;
/www/htdocs/inc&lt;br /&gt;
lib.inc.php&lt;br /&gt;
php&lt;br /&gt;
lib.inc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Go BACKWARDS in array==&lt;br /&gt;
From: [https://stackoverflow.com/questions/2194388/php-how-to-get-the-element-before-the-last-element-from-an-array php-how-to-get-the-element-before-the-last-element-from-an-array]&lt;br /&gt;
* Note that you need more than 2 elements in the array for this to work properly according to answer.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$foo=[&amp;quot;one&amp;quot;,&amp;quot;two&amp;quot;,&amp;quot;three&amp;quot;,&amp;quot;four&amp;quot;];&lt;br /&gt;
echo &amp;quot;TEST &amp;quot; . $foo[count($foo)-2];&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Returns TEST three&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All arrays have an &amp;quot;internal array pointer&amp;quot; which points to the current array element, PHP has several functions which allow you to navigate through the array and view the current elements key and value.&lt;br /&gt;
&lt;br /&gt;
    end() - Set the internal pointer of an array to its last element&lt;br /&gt;
    reset() - Set the internal pointer of an array to its first element&lt;br /&gt;
    prev() - Rewind the internal array pointer&lt;br /&gt;
    next() - Advance the internal array pointer of an array&lt;br /&gt;
    current() - Return the current element in an array&lt;br /&gt;
    key() - Fetch a key from an array&lt;br /&gt;
    each() - Return the current key and value pair from an array and advance the array cursor&lt;br /&gt;
&lt;br /&gt;
== Add Space before every capital letter==&lt;br /&gt;
From [https://bytes.com/topic/php/answers/8589-how-insert-space-before-capital-letters-string -how-insert-space-before-capital-letters-string]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
preg_replace('/(\w+)([A-Z])/U', '\\1 \\2', $cleanStorage); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working with file creation and removal ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      $content = '&amp;lt;?php ' . $preProcessing . ' ?&amp;gt;';&lt;br /&gt;
      $file = dirname(__FILE__) . '/'. $event_name . '.php';&lt;br /&gt;
      file_put_contents($file, $content);&lt;br /&gt;
      include &amp;quot;$file&amp;quot;;&lt;br /&gt;
      unlink &amp;quot;$file&amp;quot;;&lt;br /&gt;
      $result['file'] = $file;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Set defaults if not provided to function ==&lt;br /&gt;
[https://stackoverflow.com/questions/9166914/using-default-arguments-in-a-function| Using defaults in a function in PHP]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function foo($blah, $x = null, $y = null) {&lt;br /&gt;
    if (null === $x) {&lt;br /&gt;
        $x = &amp;quot;some value&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    if (null === $y) {&lt;br /&gt;
        $y = &amp;quot;some other value&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    code here!&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Make Indexed Array Unique ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$temp_array = array();&lt;br /&gt;
foreach ($array as &amp;amp;$v) {&lt;br /&gt;
    if (!isset($temp_array[$v['name']]))&lt;br /&gt;
        $temp_array[$v['name']] =&amp;amp; $v;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Array by reference ==&lt;br /&gt;
Using the &amp;amp; VARIABLE will change the value within the original array.  This was given by chatGPT questions.  Nice simple example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Without reference&lt;br /&gt;
$array1 = [1, 2, 3];&lt;br /&gt;
foreach ($array1 as $v) {&lt;br /&gt;
    $v = $v * 2;&lt;br /&gt;
}&lt;br /&gt;
print_r($array1);  // Outputs: Array ( [0] =&amp;gt; 1 [1] =&amp;gt; 2 [2] =&amp;gt; 3 )&lt;br /&gt;
&lt;br /&gt;
// With reference&lt;br /&gt;
$array2 = [1, 2, 3];&lt;br /&gt;
foreach ($array2 as &amp;amp;$v) {&lt;br /&gt;
    $v = $v * 2;&lt;br /&gt;
}&lt;br /&gt;
print_r($array2);  // Outputs: Array ( [0] =&amp;gt; 2 [1] =&amp;gt; 4 [2] =&amp;gt; 6 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Slim4 Framework Notes==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return $this-&amp;gt;respondWithData($data);&lt;br /&gt;
throw new HttpBadRequestException($this-&amp;gt;request, &amp;quot;Error message details&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple PHP validation==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find src -type f -name '*.php' -exec php -l {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Some cheat-sheets ==&lt;br /&gt;
Random cheat-sheets found on the net that are kinda useful&lt;br /&gt;
&lt;br /&gt;
# [https://cheatography.com/davechild/cheat-sheets/php/| Looks like a pretty good PHP sheet]&lt;br /&gt;
# [https://cheatography.com/krabat1/cheat-sheets/php/| This one is REALLY big, but looks to have good info]&lt;br /&gt;
[[Category:PHP]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=658</id>
		<title>Git notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=658"/>
		<updated>2025-05-27T16:18:29Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* mis-synced between parent and submodule commits */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== General git commands that are useful ===&lt;br /&gt;
== Change git remote:==&lt;br /&gt;
&lt;br /&gt;
With or without ssh keys added to your user account..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin git@gitlab01.iwillfearnoevil.com:monitoring/nmsui.git&lt;br /&gt;
or:&lt;br /&gt;
git remote set-url origin https://gitlab01.iwillfearnoevil.com/monitoring/nmsui.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sort git branches by last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show git commit hashes for each branch sorted by date ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=-committerdate refs/heads/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do a git diff between two branches ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git diff &amp;lt;branch&amp;gt;..origin/&amp;lt;branch2&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update Submodules ==&lt;br /&gt;
[https://stackoverflow.com/questions/1030169/pull-latest-changes-for-all-git-submodules pull-latest-changes-for-all-git-submodules]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --recursive --init&lt;br /&gt;
git submodule update --recursive --remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Checkout specific commit hash ==&lt;br /&gt;
This can be useful when the hash is not in the expected branch, or when you are in a detached head state&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone [remote_address_here] my_repo&lt;br /&gt;
cd my_repo&lt;br /&gt;
git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change submodule URL ==&lt;br /&gt;
This is very much a hammer way of doing this.  I have seen elegant ways online, but they seem inconsistent when something goes wrong.  This way is reproducible as far as I am concerned.&lt;br /&gt;
&lt;br /&gt;
This example assumes that directory/ is where your submodule lives.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
edit .gitmodule&lt;br /&gt;
change values&lt;br /&gt;
rm -rf directory/&lt;br /&gt;
git submodule update --init --recursive --remote&lt;br /&gt;
cd into directory/&lt;br /&gt;
git pull whatever submodule branch you need&lt;br /&gt;
cd ..&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'save new submodule changes'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Save image in README.md on github.com ==&lt;br /&gt;
Per: [https://stackoverflow.com/questions/14494747/how-to-add-images-to-readme-md-on-github Stackoverflow]&lt;br /&gt;
&lt;br /&gt;
Works:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Very Simple : Can be done using Ctrl + C/V&lt;br /&gt;
&lt;br /&gt;
Most of the answers here directly or indirectly involve uploading the image somewhere else &amp;amp; then providing a link to it.&lt;br /&gt;
&lt;br /&gt;
It can be done very simply by just copying any image and pasting it while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
    Copying the image - You can just click on the image file and use Ctrl + C or may copy the screenshot image to your clipboard using the snipping tool&lt;br /&gt;
    You can then simply do Ctrl + V while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
Guithub will automatically upload it to user-images.githubusercontent.com and a link to it will be inserted there&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change remote URL ==&lt;br /&gt;
[https://stackoverflow.com/questions/2432764/how-do-i-change-the-uri-url-for-a-remote-git-repository Change Git remote URL]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin new.git.url/here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ignore local changes and pull ==&lt;br /&gt;
When you simply want to start over and nuke all your local mess....&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4157189/how-to-git-pull-while-ignoring-local-changes Stackoverflow on doing this]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git fetch --all&lt;br /&gt;
git reset --hard origin/&amp;lt;branch_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clean up local orphan branches ==&lt;br /&gt;
When you have branches locally present that have been merged on the remote server this works to clean out your local repo.&lt;br /&gt;
&lt;br /&gt;
If there are still some that you want to keep, add in a 'grep -v &amp;quot;someName&amp;quot;' before xargs&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote remove tracking branches no longer on remote]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch --merged | grep -v &amp;quot;\*&amp;quot; | xargs -n 1 git branch -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Get latest commit hash for scripts ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git rev-parse HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove submodules of submodules ==&lt;br /&gt;
* This has been a recurring painful process.  This is one solution that has worked for me&lt;br /&gt;
[https://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule Stack Overflow discussion on this]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive REPO&lt;br /&gt;
cd down/to/submodule&lt;br /&gt;
git checkout branch needed&lt;br /&gt;
rm -f .gitmodules&lt;br /&gt;
git submodule -init&lt;br /&gt;
git submodule -update&lt;br /&gt;
git rm --cached file/path/with/error/message&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove submodules of submodules'&lt;br /&gt;
git push&lt;br /&gt;
cd parent repository&lt;br /&gt;
cat .gitmodules&lt;br /&gt;
Verify no references to submodules of submodules&lt;br /&gt;
git submodule status --recursive&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove references in submodule to nested submodules'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nuke a bad commit before push ==&lt;br /&gt;
* When you have saved a commit but it is not been pushed and you want to get rid of it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Keep the work done:&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&lt;br /&gt;
Destroy all work done and get last full commit&lt;br /&gt;
git reset --hard HEAD~1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drop changes and pull submodules ==&lt;br /&gt;
* When you have a submodule that is out of whack with the main repo and you cannot figure out which commit it is supposed to be at easily&lt;br /&gt;
&lt;br /&gt;
* reset --hard gets rid of all local changes&lt;br /&gt;
* clean -fdx removes untracked files and directories&lt;br /&gt;
* The submodule update resets the submodule’s HEAD to what the parent repo wants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd path/to/submodule&lt;br /&gt;
git reset --hard&lt;br /&gt;
git clean -fdx&lt;br /&gt;
cd ..&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== mis-synced between parent and submodule commits ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Find branch in detached head ==&lt;br /&gt;
[https://stackoverflow.com/questions/6059336/how-to-find-the-current-git-branch-in-detached-head-state | Find branch in detached head]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git show-ref | grep $(git log --pretty=%h -1) | sed 's|.*/\(.*\)|\1|' | sort -u | grep -v HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=657</id>
		<title>Git notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=657"/>
		<updated>2025-05-16T15:24:40Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Drop changes and pull submodules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== General git commands that are useful ===&lt;br /&gt;
== Change git remote:==&lt;br /&gt;
&lt;br /&gt;
With or without ssh keys added to your user account..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin git@gitlab01.iwillfearnoevil.com:monitoring/nmsui.git&lt;br /&gt;
or:&lt;br /&gt;
git remote set-url origin https://gitlab01.iwillfearnoevil.com/monitoring/nmsui.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sort git branches by last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show git commit hashes for each branch sorted by date ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=-committerdate refs/heads/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do a git diff between two branches ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git diff &amp;lt;branch&amp;gt;..origin/&amp;lt;branch2&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update Submodules ==&lt;br /&gt;
[https://stackoverflow.com/questions/1030169/pull-latest-changes-for-all-git-submodules pull-latest-changes-for-all-git-submodules]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --recursive --init&lt;br /&gt;
git submodule update --recursive --remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Checkout specific commit hash ==&lt;br /&gt;
This can be useful when the hash is not in the expected branch, or when you are in a detached head state&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone [remote_address_here] my_repo&lt;br /&gt;
cd my_repo&lt;br /&gt;
git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change submodule URL ==&lt;br /&gt;
This is very much a hammer way of doing this.  I have seen elegant ways online, but they seem inconsistent when something goes wrong.  This way is reproducible as far as I am concerned.&lt;br /&gt;
&lt;br /&gt;
This example assumes that directory/ is where your submodule lives.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
edit .gitmodule&lt;br /&gt;
change values&lt;br /&gt;
rm -rf directory/&lt;br /&gt;
git submodule update --init --recursive --remote&lt;br /&gt;
cd into directory/&lt;br /&gt;
git pull whatever submodule branch you need&lt;br /&gt;
cd ..&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'save new submodule changes'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Save image in README.md on github.com ==&lt;br /&gt;
Per: [https://stackoverflow.com/questions/14494747/how-to-add-images-to-readme-md-on-github Stackoverflow]&lt;br /&gt;
&lt;br /&gt;
Works:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Very Simple : Can be done using Ctrl + C/V&lt;br /&gt;
&lt;br /&gt;
Most of the answers here directly or indirectly involve uploading the image somewhere else &amp;amp; then providing a link to it.&lt;br /&gt;
&lt;br /&gt;
It can be done very simply by just copying any image and pasting it while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
    Copying the image - You can just click on the image file and use Ctrl + C or may copy the screenshot image to your clipboard using the snipping tool&lt;br /&gt;
    You can then simply do Ctrl + V while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
Guithub will automatically upload it to user-images.githubusercontent.com and a link to it will be inserted there&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change remote URL ==&lt;br /&gt;
[https://stackoverflow.com/questions/2432764/how-do-i-change-the-uri-url-for-a-remote-git-repository Change Git remote URL]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin new.git.url/here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ignore local changes and pull ==&lt;br /&gt;
When you simply want to start over and nuke all your local mess....&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4157189/how-to-git-pull-while-ignoring-local-changes Stackoverflow on doing this]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git fetch --all&lt;br /&gt;
git reset --hard origin/&amp;lt;branch_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clean up local orphan branches ==&lt;br /&gt;
When you have branches locally present that have been merged on the remote server this works to clean out your local repo.&lt;br /&gt;
&lt;br /&gt;
If there are still some that you want to keep, add in a 'grep -v &amp;quot;someName&amp;quot;' before xargs&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote remove tracking branches no longer on remote]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch --merged | grep -v &amp;quot;\*&amp;quot; | xargs -n 1 git branch -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Get latest commit hash for scripts ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git rev-parse HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove submodules of submodules ==&lt;br /&gt;
* This has been a recurring painful process.  This is one solution that has worked for me&lt;br /&gt;
[https://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule Stack Overflow discussion on this]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive REPO&lt;br /&gt;
cd down/to/submodule&lt;br /&gt;
git checkout branch needed&lt;br /&gt;
rm -f .gitmodules&lt;br /&gt;
git submodule -init&lt;br /&gt;
git submodule -update&lt;br /&gt;
git rm --cached file/path/with/error/message&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove submodules of submodules'&lt;br /&gt;
git push&lt;br /&gt;
cd parent repository&lt;br /&gt;
cat .gitmodules&lt;br /&gt;
Verify no references to submodules of submodules&lt;br /&gt;
git submodule status --recursive&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove references in submodule to nested submodules'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nuke a bad commit before push ==&lt;br /&gt;
* When you have saved a commit but it is not been pushed and you want to get rid of it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Keep the work done:&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&lt;br /&gt;
Destroy all work done and get last full commit&lt;br /&gt;
git reset --hard HEAD~1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drop changes and pull submodules ==&lt;br /&gt;
* When you have a submodule that is out of whack with the main repo and you cannot figure out which commit it is supposed to be at easily&lt;br /&gt;
&lt;br /&gt;
* reset --hard gets rid of all local changes&lt;br /&gt;
* clean -fdx removes untracked files and directories&lt;br /&gt;
* The submodule update resets the submodule’s HEAD to what the parent repo wants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd path/to/submodule&lt;br /&gt;
git reset --hard&lt;br /&gt;
git clean -fdx&lt;br /&gt;
cd ..&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== mis-synced between parent and submodule commits ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=656</id>
		<title>Git notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=656"/>
		<updated>2025-05-16T15:23:39Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Nuke a bad commit before push */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== General git commands that are useful ===&lt;br /&gt;
== Change git remote:==&lt;br /&gt;
&lt;br /&gt;
With or without ssh keys added to your user account..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin git@gitlab01.iwillfearnoevil.com:monitoring/nmsui.git&lt;br /&gt;
or:&lt;br /&gt;
git remote set-url origin https://gitlab01.iwillfearnoevil.com/monitoring/nmsui.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sort git branches by last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show git commit hashes for each branch sorted by date ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=-committerdate refs/heads/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do a git diff between two branches ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git diff &amp;lt;branch&amp;gt;..origin/&amp;lt;branch2&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update Submodules ==&lt;br /&gt;
[https://stackoverflow.com/questions/1030169/pull-latest-changes-for-all-git-submodules pull-latest-changes-for-all-git-submodules]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --recursive --init&lt;br /&gt;
git submodule update --recursive --remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Checkout specific commit hash ==&lt;br /&gt;
This can be useful when the hash is not in the expected branch, or when you are in a detached head state&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone [remote_address_here] my_repo&lt;br /&gt;
cd my_repo&lt;br /&gt;
git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change submodule URL ==&lt;br /&gt;
This is very much a hammer way of doing this.  I have seen elegant ways online, but they seem inconsistent when something goes wrong.  This way is reproducible as far as I am concerned.&lt;br /&gt;
&lt;br /&gt;
This example assumes that directory/ is where your submodule lives.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
edit .gitmodule&lt;br /&gt;
change values&lt;br /&gt;
rm -rf directory/&lt;br /&gt;
git submodule update --init --recursive --remote&lt;br /&gt;
cd into directory/&lt;br /&gt;
git pull whatever submodule branch you need&lt;br /&gt;
cd ..&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'save new submodule changes'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Save image in README.md on github.com ==&lt;br /&gt;
Per: [https://stackoverflow.com/questions/14494747/how-to-add-images-to-readme-md-on-github Stackoverflow]&lt;br /&gt;
&lt;br /&gt;
Works:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Very Simple : Can be done using Ctrl + C/V&lt;br /&gt;
&lt;br /&gt;
Most of the answers here directly or indirectly involve uploading the image somewhere else &amp;amp; then providing a link to it.&lt;br /&gt;
&lt;br /&gt;
It can be done very simply by just copying any image and pasting it while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
    Copying the image - You can just click on the image file and use Ctrl + C or may copy the screenshot image to your clipboard using the snipping tool&lt;br /&gt;
    You can then simply do Ctrl + V while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
Guithub will automatically upload it to user-images.githubusercontent.com and a link to it will be inserted there&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change remote URL ==&lt;br /&gt;
[https://stackoverflow.com/questions/2432764/how-do-i-change-the-uri-url-for-a-remote-git-repository Change Git remote URL]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin new.git.url/here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ignore local changes and pull ==&lt;br /&gt;
When you simply want to start over and nuke all your local mess....&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4157189/how-to-git-pull-while-ignoring-local-changes Stackoverflow on doing this]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git fetch --all&lt;br /&gt;
git reset --hard origin/&amp;lt;branch_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clean up local orphan branches ==&lt;br /&gt;
When you have branches locally present that have been merged on the remote server this works to clean out your local repo.&lt;br /&gt;
&lt;br /&gt;
If there are still some that you want to keep, add in a 'grep -v &amp;quot;someName&amp;quot;' before xargs&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote remove tracking branches no longer on remote]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch --merged | grep -v &amp;quot;\*&amp;quot; | xargs -n 1 git branch -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Get latest commit hash for scripts ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git rev-parse HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove submodules of submodules ==&lt;br /&gt;
* This has been a recurring painful process.  This is one solution that has worked for me&lt;br /&gt;
[https://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule Stack Overflow discussion on this]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive REPO&lt;br /&gt;
cd down/to/submodule&lt;br /&gt;
git checkout branch needed&lt;br /&gt;
rm -f .gitmodules&lt;br /&gt;
git submodule -init&lt;br /&gt;
git submodule -update&lt;br /&gt;
git rm --cached file/path/with/error/message&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove submodules of submodules'&lt;br /&gt;
git push&lt;br /&gt;
cd parent repository&lt;br /&gt;
cat .gitmodules&lt;br /&gt;
Verify no references to submodules of submodules&lt;br /&gt;
git submodule status --recursive&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove references in submodule to nested submodules'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nuke a bad commit before push ==&lt;br /&gt;
* When you have saved a commit but it is not been pushed and you want to get rid of it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Keep the work done:&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&lt;br /&gt;
Destroy all work done and get last full commit&lt;br /&gt;
git reset --hard HEAD~1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drop changes and pull submodules ==&lt;br /&gt;
* When you have a submodule that is out of whack with the main repo and you cannot figure out which commit it is supposed to be at easily&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd path/to/submodule&lt;br /&gt;
git reset --hard&lt;br /&gt;
git clean -fdx&lt;br /&gt;
cd ..&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== mis-synced between parent and submodule commits ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --init --recursive --force&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=655</id>
		<title>Git notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Git_notes&amp;diff=655"/>
		<updated>2025-05-02T17:59:07Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== General git commands that are useful ===&lt;br /&gt;
== Change git remote:==&lt;br /&gt;
&lt;br /&gt;
With or without ssh keys added to your user account..&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin git@gitlab01.iwillfearnoevil.com:monitoring/nmsui.git&lt;br /&gt;
or:&lt;br /&gt;
git remote set-url origin https://gitlab01.iwillfearnoevil.com/monitoring/nmsui.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sort git branches by last commit ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Show git commit hashes for each branch sorted by date ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git for-each-ref --sort=-committerdate refs/heads/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Do a git diff between two branches ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git diff &amp;lt;branch&amp;gt;..origin/&amp;lt;branch2&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Update Submodules ==&lt;br /&gt;
[https://stackoverflow.com/questions/1030169/pull-latest-changes-for-all-git-submodules pull-latest-changes-for-all-git-submodules]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git submodule update --recursive --init&lt;br /&gt;
git submodule update --recursive --remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Checkout specific commit hash ==&lt;br /&gt;
This can be useful when the hash is not in the expected branch, or when you are in a detached head state&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone [remote_address_here] my_repo&lt;br /&gt;
cd my_repo&lt;br /&gt;
git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change submodule URL ==&lt;br /&gt;
This is very much a hammer way of doing this.  I have seen elegant ways online, but they seem inconsistent when something goes wrong.  This way is reproducible as far as I am concerned.&lt;br /&gt;
&lt;br /&gt;
This example assumes that directory/ is where your submodule lives.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
edit .gitmodule&lt;br /&gt;
change values&lt;br /&gt;
rm -rf directory/&lt;br /&gt;
git submodule update --init --recursive --remote&lt;br /&gt;
cd into directory/&lt;br /&gt;
git pull whatever submodule branch you need&lt;br /&gt;
cd ..&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'save new submodule changes'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Save image in README.md on github.com ==&lt;br /&gt;
Per: [https://stackoverflow.com/questions/14494747/how-to-add-images-to-readme-md-on-github Stackoverflow]&lt;br /&gt;
&lt;br /&gt;
Works:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Very Simple : Can be done using Ctrl + C/V&lt;br /&gt;
&lt;br /&gt;
Most of the answers here directly or indirectly involve uploading the image somewhere else &amp;amp; then providing a link to it.&lt;br /&gt;
&lt;br /&gt;
It can be done very simply by just copying any image and pasting it while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
    Copying the image - You can just click on the image file and use Ctrl + C or may copy the screenshot image to your clipboard using the snipping tool&lt;br /&gt;
    You can then simply do Ctrl + V while editing Readme.md&lt;br /&gt;
&lt;br /&gt;
Guithub will automatically upload it to user-images.githubusercontent.com and a link to it will be inserted there&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change remote URL ==&lt;br /&gt;
[https://stackoverflow.com/questions/2432764/how-do-i-change-the-uri-url-for-a-remote-git-repository Change Git remote URL]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git remote set-url origin new.git.url/here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ignore local changes and pull ==&lt;br /&gt;
When you simply want to start over and nuke all your local mess....&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/4157189/how-to-git-pull-while-ignoring-local-changes Stackoverflow on doing this]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git fetch --all&lt;br /&gt;
git reset --hard origin/&amp;lt;branch_name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clean up local orphan branches ==&lt;br /&gt;
When you have branches locally present that have been merged on the remote server this works to clean out your local repo.&lt;br /&gt;
&lt;br /&gt;
If there are still some that you want to keep, add in a 'grep -v &amp;quot;someName&amp;quot;' before xargs&lt;br /&gt;
&lt;br /&gt;
[https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote remove tracking branches no longer on remote]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch --merged | grep -v &amp;quot;\*&amp;quot; | xargs -n 1 git branch -d&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Get latest commit hash for scripts ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git rev-parse HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove submodules of submodules ==&lt;br /&gt;
* This has been a recurring painful process.  This is one solution that has worked for me&lt;br /&gt;
[https://stackoverflow.com/questions/4185365/no-submodule-mapping-found-in-gitmodule-for-a-path-thats-not-a-submodule Stack Overflow discussion on this]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone --recursive REPO&lt;br /&gt;
cd down/to/submodule&lt;br /&gt;
git checkout branch needed&lt;br /&gt;
rm -f .gitmodules&lt;br /&gt;
git submodule -init&lt;br /&gt;
git submodule -update&lt;br /&gt;
git rm --cached file/path/with/error/message&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove submodules of submodules'&lt;br /&gt;
git push&lt;br /&gt;
cd parent repository&lt;br /&gt;
cat .gitmodules&lt;br /&gt;
Verify no references to submodules of submodules&lt;br /&gt;
git submodule status --recursive&lt;br /&gt;
git status&lt;br /&gt;
git add -A&lt;br /&gt;
git commit -m 'Remove references in submodule to nested submodules'&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Nuke a bad commit before push ==&lt;br /&gt;
* When you have saved a commit but it is not been pushed and you want to get rid of it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Keep the work done:&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&lt;br /&gt;
Destroy all work done and get last full commit&lt;br /&gt;
git reset --hard HEAD~1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=654</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Main_Page&amp;diff=654"/>
		<updated>2025-04-21T18:31:49Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Fault Management notes, thoughts, and example code&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
My code is finally up on github.com!  Right now I am squishing bugs that I am finding which are not critical issues, but look bad.  Additionally I have begun the ECE or event correlation engine work for the different dashboards.  I still have not gotten to an installer, or added the seed data for the database.  I will be focusing on that soon.  I want to get a little more functionality in place to prove the tool is useful before focusing on this part.  Additionally I have had some thoughts on how to templatize some of the checks better.  I am  still kinda kicking the idea around right now to see what kind of weak points I will run into, but the basic idea is along the lines of give me a SNMP table, and if return data is numbers graph/save it.  If args are passed for what we care about, parse and event on what is found all at the template level.  I think that I can build a simple skeleton for this where just about anything can be added for the check by doing this.  String compare, existence, or number comparison.  I kinda like this idea, since we can get a lot of data, but 99% of the time we only care about specific parts of a given table.  I would like to make this something that can be created from the web page if possible, but I am not sure how ugly that would get..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am mainly updating this wiki for the NMS work I am doing, and attempting to get some more exposure in the greater world for assistance on code.  I am not a developer, just someone who is frustrated at a lack of good tools.  I will be adding the NMS up to gitgub in the future as two separate repos.  The first one will be the API server.  The second is the front-end UI portion.  &lt;br /&gt;
&lt;br /&gt;
The backend is written in PHP, and has recently been migrated from PHP7.4 to 8.1.  I used the Slim4 skeleton as the base of the application.&lt;br /&gt;
&lt;br /&gt;
The frontend is using bootstrap, PHP and javascript.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-21-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still running 2X2 on server.  Load Average consistent 1.10 15 min, and peaks 3.50 on 1min when iteration starts up&lt;br /&gt;
* Not been focused on this too much lately.  Continuing to try to get Devices to look the way they do in my head...&lt;br /&gt;
* Still eating Crayons...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 03-26-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still working on UX, as I know I do not make pretty pages&lt;br /&gt;
* Looks a little better on the branch I am working on, but still not amazing or great... Sigh...&lt;br /&gt;
* I should stick to eating Crayons instead of trying to use them to make something good looking...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 01-02-25&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently working on getting the UI to not look like a first time high school project&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Investigating template rework to better calculate percentages to store in metrics&lt;br /&gt;
* Beginning to investigate storing metric data in influxdb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-30-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Currently hitting performance limits with 2 core/2G RAM with 61 servers.  Server getting laggy..&lt;br /&gt;
* Will encourage setups as &amp;lt; 50 servers, 2x2 is fine.&lt;br /&gt;
* &amp;gt; 51 and &amp;lt; 125 testing as 4x2.  This is not a RAM intense app, it is more thready and core bound.  Then Drive IO is going to become the bottleneck before RAM&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-15-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Purchased ChartJS license (I may hate JS, but it makes pretty pics)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 10-08-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Minor bug squishing&lt;br /&gt;
* Testing using evil Javascript to make pretty graphs&lt;br /&gt;
* Going to license CanvasJS for this (even a n00b can figure it out)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 08-18-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Some minor bug fixes, but not too much coding done&lt;br /&gt;
* beginning focus on ECE and seeing what a mess it is.  Not happy about it.  Will likely redesign this since it was a skel anyway.  This needs to be simple and understandable dammit.&lt;br /&gt;
* Looking at changing frontend UI for main page.  &lt;br /&gt;
* Building more templates for standards&lt;br /&gt;
* Dblchecking my logic for NRPE or shell commands.  This could use more work.  NRPE failing for something not the command itself should have discrete alarm values.  Need to think about this more..&lt;br /&gt;
* SNMP checks need to be smarter, and need parsible thresholds on a per host basis, not a per check basis&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update status: 04-16-24&amp;lt;/strong&amp;gt;&lt;br /&gt;
* Still squishy-squishy on bugs&lt;br /&gt;
* Focusing on stability and clean UI&lt;br /&gt;
&lt;br /&gt;
Current Loads: 47 devices&lt;br /&gt;
* 2 core 2 GB RAM&lt;br /&gt;
* Load averages consistent: 0.70,1.5,1.6&lt;br /&gt;
* From this with a average number of checks ( ~10 per host ) reliable monitoring can be done on 50 devices with decent results and minimal hardware for small environments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 03-21-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Many Many squishes of bugs&lt;br /&gt;
* Reporting engine and templates much more usable&lt;br /&gt;
* More documentation links for application with base examples written&lt;br /&gt;
* Initial Event Correlation Engine (ECE) rules written&lt;br /&gt;
* Some pages written for ECE&lt;br /&gt;
* Did I mention squishing bugs?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt; Update on status: 02-11-2024 &amp;lt;/strong&amp;gt;&lt;br /&gt;
* Upgraded API to use PHP 8.2, not 8.1.&lt;br /&gt;
* GUI code was sanitized and released to github&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-GUI Vigilare GUI]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-API Vigilare API]&lt;br /&gt;
* [https://github.com/Guyverix/Vigilare-NMS-POLLER Vigilare Pollers]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The focus of this wiki is for notes and gotchas for things relating to technology.  It is mainly focused on the fault management tool that I am writing.  However oddball things I have found or commonly forget since I rarely use them are also present.  I do not go too in depth on the notes or what I find.  In general it is more a quick summary and if reasonable an example that shows what the result is.  I suspect that as time passes it will become more focused on the tool that I am writing.  However there will likely be oddball stuff thrown in here as well that does not have to do with fault management at all....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Overall idea&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I believe that fault management is commonly very much overlooked in many companies and more of a bolt-on after they have been embarrassed by an outage or network event that a customer noticed.  This feels backwards to me.  Fault management really should be one of the first things put into place and grow with your software and network over time.  Being able to tell at a glance the &amp;quot;truth&amp;quot; of your network is almost as critical as the network running itself!  Customer monitoring isn't monitoring and simply makes you look bad.  If a customer or end user has to tell you something is down, you have failed.  If it happens more than once then that should set off all kinds of warnings to technicians.  This should not happen.  The problem happens in my opinion due to management seeing monitoring as a time suck that does not really return money on their investment of time.  The only time they care is when they get embarrassed, and after that they loose interest until they are embarrassed again.  This is stupid.  A company or technician must be able to say with confidence that their applications are working AND PROVE IT.  If you cant prove anything it is just a hope that things are working as designed.  Until you know, you simply are guessing on the health and availability of an application.&lt;br /&gt;
&lt;br /&gt;
I have noticed a trend recently that companies are going to what I call &amp;quot;implied&amp;quot; monitoring.  More looking at metrics than active validation of an application or service.  While this does somewhat fit the bill for monitoring it does a major dis-service to the technicians that need to support the application.  Usually this kind of monitoring will cry when something is down but does not tell you what, or where the issue happens.  Only that it is happening.  It is also usually slower to report the failures.  That means more time for a customer to find issues than the technician.  Parsing logs, and dropping them in search indexes, or forwarding matches as events are all very useful, but they are not really watching for specific application issues at the host level.  I believe that an organization must work up to this kind of monitoring.  It must be bult on the basics.  If you do not have the basics in place, then the advanced monitoring is much less useful for an org.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;&lt;br /&gt;
My common way to approach monitoring is to start as fundamental as possible.  On Linux based systems this is the way that has given me the best results.&lt;br /&gt;
&lt;br /&gt;
* daemon&lt;br /&gt;
** dead daemon, well dead app :)&lt;br /&gt;
* port&lt;br /&gt;
** zombie processes holding a port, or different daemons attempting to use the same port is bad&lt;br /&gt;
* challenge and response.&lt;br /&gt;
** Verify which app has control of the port (did you get an http, email, ssh header?  Did it respond at all?)&lt;br /&gt;
* performance&lt;br /&gt;
** This is the n+1 point.  After confirming the application is running, NOW is the time to verify it is at a basic level performant.&lt;br /&gt;
* log and event parsing&lt;br /&gt;
** In depth log parsing, and event correlations.  Without the above this is much less useful to a technician.&lt;br /&gt;
*** I have seen in RARE cases this done well, where it states what failed and which host.  However that is much less likely to happen as the logs parsed do not always state which application is at fault, only that there is one present.&lt;br /&gt;
&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How you get the answers is less important than getting the answers, with one gotcha.  There is no reason to degrade the host with a complex and slow service check.  If the validation cannot be done cheaply, then it is likely something that should be broken down into more basic pieces.  Killing your servers or pod with service checks is exactly backwards of what you need.  Simple, fast, and accurate are what you need to focus on.  Inaccurate data is WORSE than no data.  Another useful trick is to assume failure until the application proves that it is doing what you expect.  I always try to avoid a bias of assuming something works until it can prove it in a service check.  Until that time, it is only your opinion that things are working.&lt;br /&gt;
&lt;br /&gt;
Historically this has been with SNMP and NRPE service checks on a common 5 minute iteration cycle.  This allows for scale of many checks across a fleet of hosts within the cycle, as well as a decent starting point for monitoring hosts.  I realize that some technicians prefer a faster cycle time, but at the end of the day, you are still talking about human response times and investigation times.  Getting things like sub-minute reporting does no good at all to a technician who is troubleshooting an issue.  Additionally, fast cycle times do not really lend themselves well to the concept of retry.  You will loose packets from time to time, your application will do weird crap from time to time.  That's just fact.  Make sure your monitoring does not loose its mind and scream the world is burning due to a transient packet-loss issue.  Using something like retry will make it more likely you are picking up a legitimate event and not a transient failure.&lt;br /&gt;
&lt;br /&gt;
Every time there is an &amp;quot;Outage&amp;quot; or severe service degrade, one of the first things that should be brought up is did the monitoring catch this issue?  Was it actually granular enough to state what the issue was, or just a side affect of the issue?  Getting an alarm for webiste down, vs. database down are two very different things.  Both will imply a 100% outage, but usually one is faster to repair than the other.  Also looking at the wrong things; say the webserver when the database is toast simply slows down the response for getting a database back online.&lt;br /&gt;
&lt;br /&gt;
== History of this wiki ==&lt;br /&gt;
&amp;lt;strong&amp;gt;MediaWiki destination for random notes and examples I do not want to loose or forget.&amp;lt;/strong&amp;gt;&lt;br /&gt;
* The site is for myself and friends who commonly use bash and other utilities and can have a one-stop-shop to find that oddball thing that was found six months ago and vaguely remembered.  The site overall is not for the general public, however if you make it in here feel free to browse.  &lt;br /&gt;
* Keep in mind however I do have security measures in place and poking hard at stuff will block you from the domain for 30 days +  if you hammer really hard.&lt;br /&gt;
* '''If someone wants access to actually ADD information in here please sign up for an account, and I will likely grant access.'''  I do try to set everything into some kind of category for easier searches as well as an attempt to keep this somewhat organized.  Whenever possible (or I remember to do it) I do try to link to the original sources of the information.  They are usually from SE, or other Q&amp;amp;A sites, so some of the comments are useful as well.&lt;br /&gt;
* This is not wikipedia, likely the site is not going to be polished, since it is more of a catchall wiki on doing different things.  There is not going to be too much rhyme or reason on what is posted on this wiki.  Overall if it is something that I have had to do more than once and look up every time, I will have notes on it in here so I will not have to search next time.&lt;br /&gt;
* There will be times that there are references to personal servers on my network, or oddball hostnames that are tied to iwillfearnoevil.com.  It is unlikely that access will be granted to those hosts unless there is a very specific reason to do so.  So dont bother asking :P&lt;br /&gt;
* '''Category NMS has notes on my progress of my NMS design, and thoughts on monitoring overall'''    [https://wiki.iwillfearnoevil.com/mediawiki/index.php/Category:NMS Category NMS]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Notes on using Mediawiki ==&lt;br /&gt;
Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;br /&gt;
[[Category:General]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Ssh&amp;diff=653</id>
		<title>Category:Ssh</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Category:Ssh&amp;diff=653"/>
		<updated>2025-04-15T20:27:11Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;Generic &amp;quot;anything&amp;quot; related specifically to ssh and ssh services&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Generic &amp;quot;anything&amp;quot; related specifically to ssh and ssh services&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Ssh&amp;diff=652</id>
		<title>Ssh</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Ssh&amp;diff=652"/>
		<updated>2025-04-15T17:37:06Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;== SSH examples for abnormal tasks == Yes, I can never remember exactly how to get the !#$!@# port forwarding done correctly.  Bah!  ===SSH port forwarding for postgres=== * Accounting for possibility of using abnormal ssh ports and strange ssh keys. * Connect pgadmin to localhost:5432 and set your authentication  &amp;lt;pre&amp;gt; export KEY=~/.ssh/some_key export PORT=2345 export JUMPBOX=192.168.15.58 ssh -i ${KEY} -p ${PORT} -L 5432:192.168.15.250:5432 SSH_USER@$${JUMPBOX} -N &amp;lt;/p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== SSH examples for abnormal tasks ==&lt;br /&gt;
Yes, I can never remember exactly how to get the !#$!@# port forwarding done correctly.  Bah!&lt;br /&gt;
&lt;br /&gt;
===SSH port forwarding for postgres===&lt;br /&gt;
* Accounting for possibility of using abnormal ssh ports and strange ssh keys.&lt;br /&gt;
* Connect pgadmin to localhost:5432 and set your authentication&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export KEY=~/.ssh/some_key&lt;br /&gt;
export PORT=2345&lt;br /&gt;
export JUMPBOX=192.168.15.58&lt;br /&gt;
ssh -i ${KEY} -p ${PORT} -L 5432:192.168.15.250:5432 SSH_USER@$${JUMPBOX} -N&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]][[Category:Ssh]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-ps-examples&amp;diff=651</id>
		<title>Bash-ps-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-ps-examples&amp;diff=651"/>
		<updated>2025-04-10T16:35:10Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Generic Page of PS options ==&lt;br /&gt;
&lt;br /&gt;
=== threads from process ===&lt;br /&gt;
See the threads for a given process&lt;br /&gt;
* [https://serverfault.com/questions/932406/how-to-tell-threads-from-processes-in-top-and-ps-on-linux show threads from process]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ps aux |grep processName&lt;br /&gt;
ps -fly -T -p PID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Bash]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-ps-examples&amp;diff=650</id>
		<title>Bash-ps-examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Bash-ps-examples&amp;diff=650"/>
		<updated>2025-04-10T16:34:59Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: Created page with &amp;quot;== Generic Page of PS options ==  === threads from process === See the threads for a given process * [https://serverfault.com/questions/932406/how-to-tell-threads-from-processes-in-top-and-ps-on-linux show threads from process] &amp;lt;pre&amp;gt; ps aux |grep processName ps -fly -T -p PID &amp;lt;/pre&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Generic Page of PS options ==&lt;br /&gt;
&lt;br /&gt;
=== threads from process ===&lt;br /&gt;
See the threads for a given process&lt;br /&gt;
* [https://serverfault.com/questions/932406/how-to-tell-threads-from-processes-in-top-and-ps-on-linux show threads from process]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ps aux |grep processName&lt;br /&gt;
ps -fly -T -p PID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Postgres&amp;diff=649</id>
		<title>Postgres</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Postgres&amp;diff=649"/>
		<updated>2025-04-10T16:29:58Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Postgres Notes ==&lt;br /&gt;
I generally use MySQL, however there have been cases where I need to use Postgres.  I can never remember the exact syntax to do basic things, so here we are...&lt;br /&gt;
&lt;br /&gt;
=== Create User and Database ===&lt;br /&gt;
Admin login to Postgeres (fresh install Pg14)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo -u postgres psql postgres&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create User&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE ROLE someUser LOGIN PASSWORD 'somePassword';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create database and add someUser as the owner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE databaseName with owner = someUser;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Validate that this worked&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
psql -h localhost -d databaseName -U someUser -p 5432&lt;br /&gt;
Password for user someUser: somePassword&lt;br /&gt;
psql (14.11 (Ubuntu 14.11-0ubuntu0.22.04.1))&lt;br /&gt;
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Useful commands to remember ===&lt;br /&gt;
* \q   quit&lt;br /&gt;
* \dt  display tables&lt;br /&gt;
* \l   list databases&lt;br /&gt;
&lt;br /&gt;
=== Migrate from MySQL to Psql ===&lt;br /&gt;
install pgloader application&lt;br /&gt;
&lt;br /&gt;
Edit script.lisp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* content of the script.lisp */&lt;br /&gt;
LOAD DATABASE&lt;br /&gt;
FROM mysql://mysqlUser:mysqlPassword@localhost|IP/oldDatabaseName&lt;br /&gt;
INTO postgresql://someUser:somePassword@localhost/databaseName;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run: pgloader script.lisp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
2024-04-03T18:56:34.028000Z LOG pgloader version &amp;quot;3.6.3~devel&amp;quot;&lt;br /&gt;
2024-04-03T18:56:34.036000Z LOG Data errors in '/tmp/pgloader/'&lt;br /&gt;
2024-04-03T18:56:34.036000Z LOG Parsing commands from file #P&amp;quot;/home/chubbard/script.lisp&amp;quot;&lt;br /&gt;
2024-04-03T18:56:34.268005Z LOG Migrating from #&amp;lt;MYSQL-CONNECTION mysql://mysqlUser@192.168.15.250:3306/oldDatabaseName {10080B3B03}&amp;gt;&lt;br /&gt;
2024-04-03T18:56:34.272005Z LOG Migrating into #&amp;lt;PGSQL-CONNECTION pgsql://someUser@localhost:5432/databaseName {10080B4783}&amp;gt;&lt;br /&gt;
2024-04-03T18:56:36.244042Z LOG report summary reset&lt;br /&gt;
             table name     errors       rows      bytes      total time&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
        fetch meta data          0          3                     1.204s&lt;br /&gt;
         Create Schemas          0          0                     0.024s&lt;br /&gt;
       Create SQL Types          0          0                     0.024s&lt;br /&gt;
          Create tables          0          2                     0.076s&lt;br /&gt;
         Set Table OIDs          0          1                     0.020s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
     databaseName.state          0          8     0.7 kB          0.084s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
COPY Threads Completion          0          4                     0.092s&lt;br /&gt;
 Index Build Completion          0          2                     0.080s&lt;br /&gt;
         Create Indexes          0          2                     0.016s&lt;br /&gt;
        Reset Sequences          0          1                     0.092s&lt;br /&gt;
           Primary Keys          0          1                     0.004s&lt;br /&gt;
    Create Foreign Keys          0          0                     0.000s&lt;br /&gt;
        Create Triggers          0          0                     0.000s&lt;br /&gt;
        Set Search Path          0          1                     0.000s&lt;br /&gt;
       Install Comments          0          0                     0.000s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
      Total import time          ✓          8     0.7 kB          0.284s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump a Postgres database ===&lt;br /&gt;
To dump just the schema and indexes&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pg_dump -s databaseName -U someUser -h localhost &amp;gt; databaseName_database_schema_postgres.sql &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Find active queries ===&lt;br /&gt;
See what is actually happening at the time of a query&lt;br /&gt;
[https://stackoverflow.com/questions/27435839/how-to-list-active-connections-on-postgresql List active connections on postgresql]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
someDb=# SELECT&lt;br /&gt;
someDb-#     pid&lt;br /&gt;
someDb-#     ,datname&lt;br /&gt;
someDb-#     ,usename&lt;br /&gt;
someDb-#     ,application_name&lt;br /&gt;
someDb-#     ,client_hostname&lt;br /&gt;
someDb-#     ,client_port&lt;br /&gt;
someDb-#     ,backend_start&lt;br /&gt;
someDb-#     ,query_start&lt;br /&gt;
someDb-#     ,query&lt;br /&gt;
someDb-#     ,state&lt;br /&gt;
someDb-# FROM pg_stat_activity&lt;br /&gt;
someDb-# WHERE state = 'active';&lt;br /&gt;
 pid  | datname | usename | application_name | client_hostname | client_port |         backend_start         |          query_start          |                  query                  | state&lt;br /&gt;
------+---------+---------+------------------+-----------------+-------------+-------------------------------+-------------------------------+-----------------------------------------+--------&lt;br /&gt;
 9132 | someDb  | someDb  | psql             |                 |          -1 | 2025-04-10 16:23:07.854726+00 | 2025-04-10 16:25:08.334369+00 | SELECT                                 +| active&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     pid                                +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,datname                           +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,usename                           +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,application_name                  +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,client_hostname                   +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,client_port                       +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,backend_start                     +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,query_start                       +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,query                             +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,state                             +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               | FROM pg_stat_activity                  +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               | WHERE state = 'active';                 |&lt;br /&gt;
 5416 |         | someDb  | walreceiver      |                 |       57680 | 2025-04-10 15:38:21.861295+00 | 2025-04-10 15:38:21.874055+00 | START_REPLICATION A/E2000000 TIMELINE 1 | active&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
[https://stackoverflow.com/questions/2172569/how-to-login-and-authenticate-to-postgresql-after-a-fresh-install| Stack Overflow fresh install notes]&lt;br /&gt;
&lt;br /&gt;
[https://serverfault.com/questions/198002/postgresql-what-does-grant-all-privileges-on-database-do| Server Fault Grants and permissions information]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Postgres]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Postgres&amp;diff=648</id>
		<title>Postgres</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Postgres&amp;diff=648"/>
		<updated>2025-04-10T16:28:58Z</updated>

		<summary type="html">&lt;p&gt;Chubbard: /* Dump a Postgres database */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Postgres Notes ==&lt;br /&gt;
I generally use MySQL, however there have been cases where I need to use Postgres.  I can never remember the exact syntax to do basic things, so here we are...&lt;br /&gt;
&lt;br /&gt;
=== Create User and Database ===&lt;br /&gt;
Admin login to Postgeres (fresh install Pg14)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo -u postgres psql postgres&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create User&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE ROLE someUser LOGIN PASSWORD 'somePassword';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create database and add someUser as the owner&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CREATE DATABASE databaseName with owner = someUser;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Validate that this worked&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
psql -h localhost -d databaseName -U someUser -p 5432&lt;br /&gt;
Password for user someUser: somePassword&lt;br /&gt;
psql (14.11 (Ubuntu 14.11-0ubuntu0.22.04.1))&lt;br /&gt;
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)&lt;br /&gt;
Type &amp;quot;help&amp;quot; for help.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Useful commands to remember ===&lt;br /&gt;
* \q   quit&lt;br /&gt;
* \dt  display tables&lt;br /&gt;
* \l   list databases&lt;br /&gt;
&lt;br /&gt;
=== Migrate from MySQL to Psql ===&lt;br /&gt;
install pgloader application&lt;br /&gt;
&lt;br /&gt;
Edit script.lisp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* content of the script.lisp */&lt;br /&gt;
LOAD DATABASE&lt;br /&gt;
FROM mysql://mysqlUser:mysqlPassword@localhost|IP/oldDatabaseName&lt;br /&gt;
INTO postgresql://someUser:somePassword@localhost/databaseName;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run: pgloader script.lisp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
2024-04-03T18:56:34.028000Z LOG pgloader version &amp;quot;3.6.3~devel&amp;quot;&lt;br /&gt;
2024-04-03T18:56:34.036000Z LOG Data errors in '/tmp/pgloader/'&lt;br /&gt;
2024-04-03T18:56:34.036000Z LOG Parsing commands from file #P&amp;quot;/home/chubbard/script.lisp&amp;quot;&lt;br /&gt;
2024-04-03T18:56:34.268005Z LOG Migrating from #&amp;lt;MYSQL-CONNECTION mysql://mysqlUser@192.168.15.250:3306/oldDatabaseName {10080B3B03}&amp;gt;&lt;br /&gt;
2024-04-03T18:56:34.272005Z LOG Migrating into #&amp;lt;PGSQL-CONNECTION pgsql://someUser@localhost:5432/databaseName {10080B4783}&amp;gt;&lt;br /&gt;
2024-04-03T18:56:36.244042Z LOG report summary reset&lt;br /&gt;
             table name     errors       rows      bytes      total time&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
        fetch meta data          0          3                     1.204s&lt;br /&gt;
         Create Schemas          0          0                     0.024s&lt;br /&gt;
       Create SQL Types          0          0                     0.024s&lt;br /&gt;
          Create tables          0          2                     0.076s&lt;br /&gt;
         Set Table OIDs          0          1                     0.020s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
     databaseName.state          0          8     0.7 kB          0.084s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
COPY Threads Completion          0          4                     0.092s&lt;br /&gt;
 Index Build Completion          0          2                     0.080s&lt;br /&gt;
         Create Indexes          0          2                     0.016s&lt;br /&gt;
        Reset Sequences          0          1                     0.092s&lt;br /&gt;
           Primary Keys          0          1                     0.004s&lt;br /&gt;
    Create Foreign Keys          0          0                     0.000s&lt;br /&gt;
        Create Triggers          0          0                     0.000s&lt;br /&gt;
        Set Search Path          0          1                     0.000s&lt;br /&gt;
       Install Comments          0          0                     0.000s&lt;br /&gt;
-----------------------  ---------  ---------  ---------  --------------&lt;br /&gt;
      Total import time          ✓          8     0.7 kB          0.284s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dump a Postgres database ===&lt;br /&gt;
To dump just the schema and indexes&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pg_dump -s databaseName -U someUser -h localhost &amp;gt; databaseName_database_schema_postgres.sql &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Find active queries ===&lt;br /&gt;
See what is actually happening at the time of a query&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
someDb=# SELECT&lt;br /&gt;
someDb-#     pid&lt;br /&gt;
someDb-#     ,datname&lt;br /&gt;
someDb-#     ,usename&lt;br /&gt;
someDb-#     ,application_name&lt;br /&gt;
someDb-#     ,client_hostname&lt;br /&gt;
someDb-#     ,client_port&lt;br /&gt;
someDb-#     ,backend_start&lt;br /&gt;
someDb-#     ,query_start&lt;br /&gt;
someDb-#     ,query&lt;br /&gt;
someDb-#     ,state&lt;br /&gt;
someDb-# FROM pg_stat_activity&lt;br /&gt;
someDb-# WHERE state = 'active';&lt;br /&gt;
 pid  | datname | usename | application_name | client_hostname | client_port |         backend_start         |          query_start          |                  query                  | state&lt;br /&gt;
------+---------+---------+------------------+-----------------+-------------+-------------------------------+-------------------------------+-----------------------------------------+--------&lt;br /&gt;
 9132 | someDb  | someDb  | psql             |                 |          -1 | 2025-04-10 16:23:07.854726+00 | 2025-04-10 16:25:08.334369+00 | SELECT                                 +| active&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     pid                                +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,datname                           +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,usename                           +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,application_name                  +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,client_hostname                   +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,client_port                       +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,backend_start                     +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,query_start                       +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,query                             +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               |     ,state                             +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               | FROM pg_stat_activity                  +|&lt;br /&gt;
      |         |         |                  |                 |             |                               |                               | WHERE state = 'active';                 |&lt;br /&gt;
 5416 |         | someDb  | walreceiver      |                 |       57680 | 2025-04-10 15:38:21.861295+00 | 2025-04-10 15:38:21.874055+00 | START_REPLICATION A/E2000000 TIMELINE 1 | active&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
[https://stackoverflow.com/questions/2172569/how-to-login-and-authenticate-to-postgresql-after-a-fresh-install| Stack Overflow fresh install notes]&lt;br /&gt;
&lt;br /&gt;
[https://serverfault.com/questions/198002/postgresql-what-does-grant-all-privileges-on-database-do| Server Fault Grants and permissions information]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Postgres]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
</feed>