From a5b5dd3e8261a76787c4674d0099d997e38ff55d Mon Sep 17 00:00:00 2001 From: Charles N Wyble Date: Wed, 19 Jan 2022 18:48:06 -0600 Subject: [PATCH] Initial capture from pfv-toolbox --- aliases | 3 + distro | 114 ++++++++ fixcpuperf.sh | 10 + fixeth.sh | 23 ++ installLynis.sh | 8 + k3spub | 10 + librenms.tar.gz | Bin 0 -> 10012 bytes librenms/distro | 114 ++++++++ librenms/ntp-client.sh | 25 ++ librenms/ntp-server.sh | 89 ++++++ librenms/os-updates.sh | 73 +++++ librenms/postfix-queues | 13 + librenms/postfixdetailed | 545 +++++++++++++++++++++++++++++++++++++ librenms/smart | 363 ++++++++++++++++++++++++ librenms/smart.config | 3 + librenms/snmpd.conf | 32 +++ main.cf | 48 ++++ netdata-stream.conf | 5 + newSrv.sh | 256 +++++++++++++++++ newSrv.sh.txt | 256 +++++++++++++++++ nsswitch.conf | 22 ++ ntp.conf | 6 + omsa.sh | 32 +++ profiled-notify-discord.sh | 9 + profiled-tmux.sh | 4 + profiled-tsys-shell.sh | 3 + prox.sh | 13 + prox7.sh | 13 + resolv.conf | 4 + rsyslog.conf | 17 ++ snmpd.conf | 40 +++ ssh-authorized-keys | 8 + sssd.conf | 15 + up2date.sh | 16 ++ 34 files changed, 2192 insertions(+) create mode 100644 aliases create mode 100644 distro create mode 100644 fixcpuperf.sh create mode 100644 fixeth.sh create mode 100644 installLynis.sh create mode 100644 k3spub create mode 100644 librenms.tar.gz create mode 100644 librenms/distro create mode 100644 librenms/ntp-client.sh create mode 100644 librenms/ntp-server.sh create mode 100644 librenms/os-updates.sh create mode 100644 librenms/postfix-queues create mode 100644 librenms/postfixdetailed create mode 100644 librenms/smart create mode 100644 librenms/smart.config create mode 100644 librenms/snmpd.conf create mode 100644 main.cf create mode 100644 netdata-stream.conf create mode 100644 newSrv.sh create mode 100644 newSrv.sh.txt create mode 100644 nsswitch.conf create mode 100644 ntp.conf create mode 100644 omsa.sh create mode 100644 profiled-notify-discord.sh create mode 100644 profiled-tmux.sh create mode 100644 profiled-tsys-shell.sh create mode 100644 prox.sh create mode 100644 prox7.sh create mode 100644 resolv.conf create mode 100644 rsyslog.conf create mode 100644 snmpd.conf create mode 100644 ssh-authorized-keys create mode 100644 sssd.conf create mode 100644 up2date.sh diff --git a/aliases b/aliases new file mode 100644 index 0000000..b09586d --- /dev/null +++ b/aliases @@ -0,0 +1,3 @@ +# See man 5 aliases for format +postmaster: root +root: prodtechopsalerts@turnsys.com diff --git a/distro b/distro new file mode 100644 index 0000000..61ad248 --- /dev/null +++ b/distro @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +# Detects which OS and if it is Linux then it will detect which Linux Distribution. + +OS=`uname -s` +REV=`uname -r` +MACH=`uname -m` + +if [ "${OS}" = "SunOS" ] ; then + OS=Solaris + ARCH=`uname -p` + OSSTR="${OS} ${REV}(${ARCH} `uname -v`)" + +elif [ "${OS}" = "AIX" ] ; then + OSSTR="${OS} `oslevel` (`oslevel -r`)" + +elif [ "${OS}" = "Linux" ] ; then + KERNEL=`uname -r` + + if [ -f /etc/fedora-release ]; then + DIST=$(cat /etc/fedora-release | awk '{print $1}') + REV=`cat /etc/fedora-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/redhat-release ] ; then + DIST=$(cat /etc/redhat-release | awk '{print $1}') + if [ "${DIST}" = "CentOS" ]; then + DIST="CentOS" + elif [ "${DIST}" = "Mandriva" ]; then + DIST="Mandriva" + PSEUDONAME=`cat /etc/mandriva-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/mandriva-release | sed s/.*release\ // | sed s/\ .*//` + elif [ -f /etc/oracle-release ]; then + DIST="Oracle" + else + DIST="RedHat" + fi + + PSEUDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/mandrake-release ] ; then + DIST='Mandrake' + PSEUDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/devuan_version ] ; then + DIST="Devuan `cat /etc/devuan_version`" + REV="" + + elif [ -f /etc/debian_version ] ; then + DIST="Debian `cat /etc/debian_version`" + REV="" + ID=`lsb_release -i | awk -F ':' '{print $2}' | sed 's/ //g'` + if [ "${ID}" = "Raspbian" ] ; then + DIST="Raspbian `cat /etc/debian_version`" + fi + + elif [ -f /etc/gentoo-release ] ; then + DIST="Gentoo" + REV=$(tr -d '[[:alpha:]]' n&+^I; zFccAi0FA?n%F+Jz*WEJ!K@f7}xHkJLl+Odm7T*L2T}9Q(=_?kuQ3`S(2yeD-#B z=y!8(r;+|0KTn$5jm>7W*=TI-J!v$zwl_DQz|NDu;E96J@ByAUo@qEyAp8gL{s{j6 z^l@VSyWxBTXZKO~wP5;}>VJ1{dncp+-DU&z-}t8gfBUocUH!^->%ml8gHuNsfqAFbx;xQAmU{uw5uM zYNqE-sxT9VYrEHAPYAF4QGjdAgoRAPsU1LI`u02ovO&|ag&U#`5)&8f5N4<%xb}$O z5(2XZ90+phk57Mj4PF#d?`Xq;?YZDhpokP7V8aCeV-XN<-h^&<<9s*kwNYApEFd(?M+!@mA8thpQ5(*l@E%!>$&9+%&FmC3(_#^1?@F* zQP2Ua@y10DxFuneLaD{_2!)=tuOC5Y&_C|IXq6g8w(FvXuJRT(CQyJ9p>rlyU?!}j>>RqK5zRFOS=*{Tz@4fL@AASk#4%2o{ ze*P1*y9w=iyWjmX+C8F0b6Jt%R|#?R&kJ$uD}=cH6++zk3L)+)A(GQA%(@F38_ETg zl@?2gP(=Bbw`-fV-T6*A<-cbmz4NLYcbi08@(tU=bR-PkYr+Y{L#V%`FoE-uDSq&{ z5P1{FCCTE6jECgXG>>H`KV%nAVU;gjo-KO)xc5pQ_4*xssHZG~*ndtuO%l&g@94eP zdiVL+@iB&`$I`MTp&{vt{tL<3nsDCTKS$06buu_VZ=*F0_2b^j$)jo6pt{4s>8aj5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t+*ZnR!v|L+)ozv}+~&PM$H=jPpF|Np(& z|ICHZ#_Wd|NBVM_0Z*1~%Xp^kfhLzDp>yqjwHt(77Rc?K7D(fA0rp3i349GnWvJaK zd`_n@U`2BQ1keDpN(1VLxo-*tmJ+d-%hp#CECMRatJvp;7c;iX! zjX$AG_^I~pom>}*>G)0Hbve(;ZtHOO$jUbMI&v>dxzxv6dn&8rdoZ1 zJ1x1+Z$EACWAy3C-tO6cn~kjuUoj1=ES}F>l={47?Pn{TTgYaRYhzarBbQ>h9$8&g zV6}}ke&x*4$S_#BS^ib6E6om}!cr39;1R0t66goe3X4#F%Gc*pzP=RYBwZ2WVON_# zI>T0sRQ?SZkX<)IJ!u+6L!6>=D}fQnQ{jI9H()`I3lSDr`O^@rW@?D1m($^7n!pQW zuJGvMxF1y1$SJB%hT){TC|eAZk01VOzR1*K)n0@m6rl)3C_)j6P=q2Bp$J7NLJ^8k mgd!B72t_DD5sFZRA{3zrMJPfMico|iQ1~Bjzft1=$N&IugL`lQ literal 0 HcmV?d00001 diff --git a/librenms/distro b/librenms/distro new file mode 100644 index 0000000..61ad248 --- /dev/null +++ b/librenms/distro @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +# Detects which OS and if it is Linux then it will detect which Linux Distribution. + +OS=`uname -s` +REV=`uname -r` +MACH=`uname -m` + +if [ "${OS}" = "SunOS" ] ; then + OS=Solaris + ARCH=`uname -p` + OSSTR="${OS} ${REV}(${ARCH} `uname -v`)" + +elif [ "${OS}" = "AIX" ] ; then + OSSTR="${OS} `oslevel` (`oslevel -r`)" + +elif [ "${OS}" = "Linux" ] ; then + KERNEL=`uname -r` + + if [ -f /etc/fedora-release ]; then + DIST=$(cat /etc/fedora-release | awk '{print $1}') + REV=`cat /etc/fedora-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/redhat-release ] ; then + DIST=$(cat /etc/redhat-release | awk '{print $1}') + if [ "${DIST}" = "CentOS" ]; then + DIST="CentOS" + elif [ "${DIST}" = "Mandriva" ]; then + DIST="Mandriva" + PSEUDONAME=`cat /etc/mandriva-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/mandriva-release | sed s/.*release\ // | sed s/\ .*//` + elif [ -f /etc/oracle-release ]; then + DIST="Oracle" + else + DIST="RedHat" + fi + + PSEUDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/mandrake-release ] ; then + DIST='Mandrake' + PSEUDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//` + REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//` + + elif [ -f /etc/devuan_version ] ; then + DIST="Devuan `cat /etc/devuan_version`" + REV="" + + elif [ -f /etc/debian_version ] ; then + DIST="Debian `cat /etc/debian_version`" + REV="" + ID=`lsb_release -i | awk -F ':' '{print $2}' | sed 's/ //g'` + if [ "${ID}" = "Raspbian" ] ; then + DIST="Raspbian `cat /etc/debian_version`" + fi + + elif [ -f /etc/gentoo-release ] ; then + DIST="Gentoo" + REV=$(tr -d '[[:alpha:]]' $new ){ + return $new; + }; + + return $new - $old; +} + + +my $output=`$pflogsumm /var/log/mail.log`; + +#holds client host rejected values till the end when it is compared to the old one +my $chrNew=0; + +#holds RBL values till the end when it is compared to the old one +my $buNew=0; + +# holds recipient address rejected values till the end when it is compared to the old one +my $raruuNew=0; + +#holds the current values for checking later +my $current=''; + +my @outputA=split( /\n/, $output ); +my $int=0; +while ( defined( $outputA[$int] ) ){ + my $line=$outputA[$int]; + + $line=~s/^ *//; + $line=~s/ +/ /g; + $line=~s/\)$//; + + my $handled=0; + + #received line + if ( ( $line =~ /[0123456789] received$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $receivedC=$line; + $received=newValue( $received, $line ); + $handled=1; + } + + #delivered line + if ( ( $line =~ /[0123456789] delivered$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $deliveredC=$line; + $delivered=newValue( $delivered, $line ); + $handled=1; + } + + #forward line + if ( ( $line =~ /[0123456789] forwarded$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $forwardedC=$line; + $forwarded=newValue( $forwarded, $line ); + $handled=1; + } + + #defereed line + if ( ( $line =~ /[0123456789] deferred \(/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $deferredC=$line; + $deferred=newValue( $deferred, $line ); + $handled=1; + } + + #bounced line + if ( ( $line =~ /[0123456789] bounced$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $bouncedC=$line; + $bounced=newValue( $bounced, $line ); + $handled=1; + } + + #rejected line + if ( ( $line =~ /[0123456789] rejected \(/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $rejectedC=$line; + $rejected=newValue( $rejected, $line ); + $handled=1; + } + + #reject warning line + if ( ( $line =~ /[0123456789] reject warnings/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $rejectwC=$line; + $rejectw=newValue( $rejectw, $line ); + $handled=1; + } + + #held line + if ( ( $line =~ /[0123456789] held$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $heldC=$line; + $held=newValue( $held, $line ); + $handled=1; + } + + #discarded line + if ( ( $line =~ /[0123456789] discarded \(/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $discardedC=$line; + $discarded=newValue( $discarded, $line ); + $handled=1; + } + + #bytes received line + if ( ( $line =~ /[0123456789kM] bytes received$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $line=~s/k/000/; + $line=~s/M/000000/; + $bytesrC=$line; + $bytesr=newValue( $bytesr, $line ); + $handled=1; + } + + #bytes delivered line + if ( ( $line =~ /[0123456789kM] bytes delivered$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $line=~s/k/000/; + $line=~s/M/000000/; + $bytesdC=$line; + $bytesd=newValue( $bytesd, $line ); + $handled=1; + } + + #senders line + if ( ( $line =~ /[0123456789] senders$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $sendersC=$line; + $senders=newValue( $senders, $line ); + $handled=1; + } + + #sendering hosts/domains line + if ( ( $line =~ /[0123456789] sending hosts\/domains$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $sendinghdC=$line; + $sendinghd=newValue( $sendinghd, $line ); + $handled=1; + } + + #recipients line + if ( ( $line =~ /[0123456789] recipients$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $recipientsC=$line; + $recipients=newValue( $recipients, $line ); + $handled=1; + } + + #recipients line + if ( ( $line =~ /[0123456789] recipient hosts\/domains$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $recipienthdC=$line; + $recipienthd=newValue( $recipienthd, $line ); + $handled=1; + } + + # deferrals connectios refused + if ( ( $line =~ /[0123456789] 25\: Connection refused$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $deferralcrC=$line; + $deferralcr=newValue( $deferralcr, $line ); + $handled=1; + } + + # deferrals Host is down + if ( ( $line =~ /Host is down$/ ) && ( ! $handled ) ){ + $line=~s/ .*//; + $deferralhidC=$line; + $deferralhid=newValue( $deferralhid, $line ); + $handled=1; + } + + # Client host rejected + if ( ( $line =~ /Client host rejected/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $chrNew=$chrNew + $line; + $handled=1; + } + + #Helo command rejected: need fully-qualified hostname + if ( ( $line =~ /Helo command rejected\: need fully\-qualified hostname/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $hcrnfqhC=$line; + $hcrnfqh=newValue( $hcrnfqh, $line ); + $handled=1; + } + + #Sender address rejected: Domain not found + if ( ( $line =~ /Sender address rejected\: Domain not found/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $sardnfC=$line; + $sardnf=newValue( $sardnf, $line ); + $handled=1; + } + + #Sender address rejected: not owned by user + if ( ( $line =~ /Sender address rejected\: not owned by user/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $sarnobuC=$line; + $sarnobu=newValue( $sarnobu, $line ); + $handled=1; + } + + #blocked using + # These lines are RBLs so there will be more than one. + # Use $buNew to add them all up. + if ( ( $line =~ /blocked using/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $buNew=$buNew + $line; + $handled=1; + } + + #Recipient address rejected: User unknown + if ( ( $line =~ /Recipient address rejected\: User unknown/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $raruuNew=$raruuNew + $line; + $handled=1; + } + + #Helo command rejected: Invalid name + if ( ( $line =~ /Helo command rejected\: Invalid name/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $hcrinC=$line; + $hcrin=newValue( $hcrin, $line ); + } + + #Sender address rejected: need fully-qualified address + if ( ( $line =~ /Sender address rejected\: need fully-qualified address/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $sarnfqaC=$line; + $sarnfqa=newValue( $sarnfqa, $line ); + } + + #Recipient address rejected: Domain not found + if ( ( $line =~ /Recipient address rejected\: Domain not found/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $rardnfC=$line; + $rardnf=newValue( $rardnf, $line ); + } + + #Improper use of SMTP command pipelining + if ( ( $line =~ /Improper use of SMTP command pipelining/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $iuoscpC=$line; + $iuoscp=newValue( $iuoscp, $line ); + } + + #Message size exceeds fixed limit + if ( ( $line =~ /Message size exceeds fixed limit/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $mseflC=$line; + $msefl=newValue( $msefl, $line ); + } + + #Server configuration error + if ( ( $line =~ /Server configuration error/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $sceC=$line; + $sce=newValue( $sce, $line ); + } + + #Server configuration problem + if ( ( $line =~ /Server configuration problem/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $scpC=$line; + $scp=newValue( $scp, $line ); + } + + #unknown reject reason + if ( ( $line =~ /unknown reject reason/ ) && ( ! $handled ) ){ + $line=~s/.*\: //g; + $urrC=$line; + $urr=newValue( $urr, $line ); + } + $int++; +} + +# final client host rejected total +$chr=newValue( $chr, $chrNew ); + +# final RBL total +$bu=newValue( $bu, $buNew ); + +# final recipient address rejected total +$raruu=newValue( $raruu, $raruuNew ); + +my $data=$received."\n". + $delivered."\n". + $forwarded."\n". + $deferred."\n". + $bounced."\n". + $rejected."\n". + $rejectw."\n". + $held."\n". + $discarded."\n". + $bytesr."\n". + $bytesd."\n". + $senders."\n". + $sendinghd."\n". + $recipients."\n". + $recipienthd."\n". + $deferralcr."\n". + $deferralhid."\n". + $chr."\n". + $hcrnfqh."\n". + $sardnf."\n". + $sarnobu."\n". + $bu."\n". + $raruu."\n". + $hcrin."\n". + $sarnfqa."\n". + $rardnf."\n". + $rarnfqa."\n". + $iuscp."\n". + $sce."\n". + $scp."\n". + $urr."\n"; + $msefl."\n". + +print $data; + +my $current=$receivedC."\n". + $deliveredC."\n". + $forwardedC."\n". + $deferredC."\n". + $bouncedC."\n". + $rejectedC."\n". + $rejectwC."\n". + $heldC."\n". + $discardedC."\n". + $bytesrC."\n". + $bytesdC."\n". + $sendersC."\n". + $sendinghdC."\n". + $recipientsC."\n". + $recipienthdC."\n". + $deferralcrC."\n". + $deferralhidC."\n". + $chrNew."\n". + $hcrnfqhC."\n". + $sardnfC."\n". + $sarnobuC."\n". + $buNew."\n". + $raruuNew."\n". + $hcrinC."\n". + $sarnfqaC."\n". + $rardnfC."\n". + $rarnfqaC."\n". + $iuscpC."\n". + $mseflC."\n". + $sceC."\n". + $scpC."\n". + $urrC."\n"; + +open(my $fh, ">", $cache) or die "Can't open '".$cache."'"; +print $fh $current; +close($fh); diff --git a/librenms/smart b/librenms/smart new file mode 100644 index 0000000..44b7a31 --- /dev/null +++ b/librenms/smart @@ -0,0 +1,363 @@ +#!/usr/bin/env perl +#Copyright (c) 2017, Zane C. Bowers-Hadley +#All rights reserved. +# +#Redistribution and use in source and binary forms, with or without modification, +#are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +#IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +#INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +#LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +#OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +#THE POSSIBILITY OF SUCH DAMAGE. + +=for comment + +Add this to snmpd.conf like below. + + extend smart /etc/snmp/smart + +Then add to root's cron tab, if you have more than a few disks. + + */3 * * * * /etc/snmp/smart -u + +You will also need to create the config file, which defaults to the same path as the script, +but with .config appended. So if the script is located at /etc/snmp/smart, the config file +will be /etc/snmp/smart.config. Alternatively you can also specific a config via -c. + +Anything starting with a # is comment. The format for variables is $variable=$value. Empty +lines are ignored. Spaces and tabes at either the start or end of a line are ignored. Any +line with out a = or # are treated as a disk. + + #This is a comment + cache=/var/cache/smart + smartctl=/usr/local/sbin/smartctl + useSN=0 + ada0 + ada1 + +The variables are as below. + + cache = The path to the cache file to use. Default: /var/cache/smart + smartctl = The path to use for smartctl. Default: /usr/bin/env smartctl + useSN = If set to 1, it will use the disks SN for reporting instead of the device name. + 1 is the default. 0 will use the device name. + +If you want to guess at the configuration, call it with -g and it will print out what it thinks +it should be. + +=cut + +## +## You should not need to touch anything below here. +## +use warnings; +use strict; +use Getopt::Std; + +my $cache='/var/cache/smart'; +my $smartctl='/usr/bin/env smartctl'; +my @disks; +my $useSN=1; + +$Getopt::Std::STANDARD_HELP_VERSION = 1; +sub main::VERSION_MESSAGE { + print "SMART SNMP extend 0.0.0\n"; +}; + + +sub main::HELP_MESSAGE { + print "\n". + "-u Update '".$cache."'\n". + "-g Guess at the config and print it to STDOUT.\n". + "-c The config file to use.\n"; +} + +#gets the options +my %opts=(); +getopts('ugc:', \%opts); + +# guess if asked +if ( defined( $opts{g} ) ){ + + #get what path to use for smartctl + $smartctl=`which smartctl`; + chomp($smartctl); + if ( $? != 0 ){ + warn("'which smartctl' failed with a exit code of $?"); + exit 1; + } + + #try to touch the default cache location and warn if it can't be done + system('touch '.$cache.'>/dev/null'); + if ( $? != 0 ){ + $cache='#Could not touch '.$cache. "You will need to manually set it\n". + "cache=?\n"; + }else{ + $cache='cache='.$cache."\n"; + } + + my %found_disks; + + #check for drives named /dev/sd* + my @matches=glob('/dev/sd*'); + @matches=grep(!/[0-9]/, @matches); + my $matches_int=0; + while ( defined( $matches[$matches_int] ) ){ + my $device=$matches[$matches_int]; + system( $smartctl.' -A '.$device.' > /dev/null' ); + if ( $? == 0 ){ + $device =~ s/\/dev\///; + $found_disks{$device}=1; + } + + $matches_int++; + } + + #check for drives named /dev/ada* + @matches=glob('/dev/ada*'); + @matches=grep(!/[ps]/, @matches); + $matches_int=0; + while ( defined( $matches[$matches_int] ) ){ + my $device=$matches[$matches_int]; + system( $smartctl.' -A '.$device.' > /dev/null' ); + if ( $? == 0 ){ + $device =~ s/\/dev\///; + $found_disks{$device}=1; + } + + $matches_int++; + } + + #check for drives named /dev/da* + @matches=glob('/dev/da*'); + @matches=grep(!/[ps]/, @matches); + $matches_int=0; + while ( defined( $matches[$matches_int] ) ){ + my $device=$matches[$matches_int]; + system( $smartctl.' -A '.$device.' > /dev/null' ); + if ( $? == 0 ){ + $device =~ s/\/dev\///; + $found_disks{$device}=1; + } + + $matches_int++; + } + + #have smartctl scan and see if it finds anythings not get found + my $scan_output=`$smartctl --scan-open`; + my @scan_outputA=split(/\n/, $scan_output); + @scan_outputA=grep(!/ses[0-9]/, @scan_outputA); # not a disk, but may or may not have SMART attributes + @scan_outputA=grep(!/pass[0-9]/, @scan_outputA); # very likely a duplicate and a disk under another name + $matches_int=0; + while ( defined( $scan_outputA[$matches_int] ) ){ + my $device=$scan_outputA[$matches_int]; + $device =~ s/ .*//; + system( $smartctl.' -A '.$device.' > /dev/null' ); + if ( $? == 0 ){ + $device =~ s/\/dev\///; + $found_disks{$device}=1; + } + + $matches_int++; + } + + print "useSN=0\n".'smartctl='.$smartctl."\n". + $cache. + join( "\n", keys(%found_disks) )."\n"; + + exit 0; +} + +#get which config file to use +my $config=$0.'.config'; +if ( defined( $opts{c} ) ){ + $config=$opts{c}; +} + +#reads the config file, optionally +my $config_file=''; +open(my $readfh, "<", $config) or die "Can't open '".$config."'"; +read($readfh , $config_file , 1000000); +close($readfh); + +#parse the config file and remove comments and empty lines +my @configA=split(/\n/, $config_file); +@configA=grep(!/^$/, @configA); +@configA=grep(!/^\#/, @configA); +@configA=grep(!/^[\s\t]*$/, @configA); +my $configA_int=0; +while ( defined( $configA[$configA_int] ) ){ + my $line=$configA[$configA_int]; + $line=~s/^[\t\s]+//; + $line=~s/[\t\s]+$//; + + my ( $var, $val )=split(/=/, $line, 2); + + if ( $var eq 'cache' ){ + $cache=$val; + } + + if ( $var eq 'smartctl' ){ + $smartctl=$val; + } + + if ( $var eq 'useSN' ){ + $useSN=$val; + } + + if ( !defined( $val ) ){ + push(@disks, $var); + } + + $configA_int++; +} + +#if set to 1, no cache will be written and it will be printed instead +my $noWrite=0; + +# if no -u, it means we are being called from snmped +if ( ! defined( $opts{u} ) ){ + # if the cache file exists, print it, otherwise assume one is not being used + if ( -f $cache ){ + my $old=''; + open(my $readfh, "<", $cache) or die "Can't open '".$cache."'"; + read($readfh , $old , 1000000); + close($readfh); + print $old; + exit 0; + }else{ + $opts{u}=1; + $noWrite=1; + } +} + +my $toReturn=''; +my $int=0; +while ( defined($disks[$int]) ) { + my $disk=$disks[$int]; + my $disk_sn=$disk; + my $output=`$smartctl -A /dev/$disk`; + + my %IDs=( '5'=>'null', + '10'=>'null', + '173'=>'null', + '177'=>'null', + '183'=>'null', + '184'=>'null', + '187'=>'null', + '188'=>'null', + '190'=>'null', + '194'=>'null', + '196'=>'null', + '197'=>'null', + '198'=>'null', + '199'=>'null', + '231'=>'null', + '233'=>'null', + ); + + my @outputA=split( /\n/, $output ); + my $outputAint=0; + while ( defined($outputA[$outputAint]) ) { + my $line=$outputA[$outputAint]; + $line=~s/^ +//; + $line=~s/ +/ /g; + + if ( $line =~ /^[0123456789]+ / ) { + my @lineA=split(/\ /, $line, 10); + my $raw=$lineA[9]; + my $id=$lineA[0]; + + # single int raw values + if ( + ( $id == 5 ) || + ( $id == 10 ) || + ( $id == 173 ) || + ( $id == 177 ) || + ( $id == 183 ) || + ( $id == 184 ) || + ( $id == 187 ) || + ( $id == 196 ) || + ( $id == 197 ) || + ( $id == 198 ) || + ( $id == 199 ) || + ( $id == 231 ) || + ( $id == 233 ) + ) { + $IDs{$id}=$raw; + } + + # 188, Command_Timeout + if ( $id == 188 ) { + my $total=0; + my @rawA=split( /\ /, $raw ); + my $rawAint=0; + while ( defined( $rawA[$rawAint] ) ) { + $total=$total+$rawA[$rawAint]; + $rawAint++; + } + $IDs{$id}=$total; + } + + # 190, airflow temp + # 194, temp + if ( + ( $id == 190 ) || + ( $id == 194 ) + ) { + my ( $temp )=split(/\ /, $raw); + $IDs{$id}=$temp; + } + + } + + $outputAint++; + } + + #get the selftest logs + $output=`$smartctl -l selftest /dev/$disk`; + @outputA=split( /\n/, $output ); + my $completed=scalar grep(/Completed without error/, @outputA); + my $interrupted=scalar grep(/Interrupted/, @outputA); + my $read_failure=scalar grep(/read failure/, @outputA); + my $unknown_failure=scalar grep(/unknown failure/, @outputA); + my $extended=scalar grep(/Extended/, @outputA); + my $short=scalar grep(/Short/, @outputA); + my $conveyance=scalar grep(/Conveyance/, @outputA); + my $selective=scalar grep(/Selective/, @outputA); + + # get the drive serial number, if needed + my $disk_id=$disk; + if ( $useSN ){ + while (`$smartctl -i /dev/$disk` =~ /Serial Number:(.*)/g) { + $disk_id = $1; + $disk_id =~ s/^\s+|\s+$//g; + } + } + + $toReturn=$toReturn.$disk_id.','.$IDs{'5'}.','.$IDs{'10'}.','.$IDs{'173'}.','.$IDs{'177'}.','.$IDs{'183'}.','.$IDs{'184'}.','.$IDs{'187'}.','.$IDs{'188'} + .','.$IDs{'190'} .','.$IDs{'194'}.','.$IDs{'196'}.','.$IDs{'197'}.','.$IDs{'198'}.','.$IDs{'199'}.','.$IDs{'231'}.','.$IDs{'233'}.','. + $completed.','.$interrupted.','.$read_failure.','.$unknown_failure.','.$extended.','.$short.','.$conveyance.','.$selective."\n"; + + $int++; +} + +if ( ! $noWrite ){ + open(my $writefh, ">", $cache) or die "Can't open '".$cache."'"; + print $writefh $toReturn; + close($writefh); +}else{ + print $toReturn; +} diff --git a/librenms/smart.config b/librenms/smart.config new file mode 100644 index 0000000..2b12988 --- /dev/null +++ b/librenms/smart.config @@ -0,0 +1,3 @@ +smartctl=/usr/sbin/smartctl +cache=/var/cache/smart +sda diff --git a/librenms/snmpd.conf b/librenms/snmpd.conf new file mode 100644 index 0000000..ee89764 --- /dev/null +++ b/librenms/snmpd.conf @@ -0,0 +1,32 @@ +########################################################################## +# snmpd.conf +# Created by CNW on 11/3/2018 via snmpconf wizard and manual post tweaks +########################################################################### +# SECTION: Monitor Various Aspects of the Running Host +# +# The following check up on various aspects of a host. + +# disk: Check for disk space usage of a partition. +# The agent can check the amount of available disk space, and make +# sure it is above a set limit. +# +load 3 3 3 +rocommunity kn3lmgmt 10.253.3.99 +syslocation PFV +syscontact prodtechopsalerts@turnsys.com +sysservices 76 + + +#TSYS tweaks +#Temperature +#pass_persist .1.3.6.1.4.1.9.9.13.1.3 /usr/local/bin/temper-snmp +#Smart +extend smart /usr/local/librenms/smart +#NTP +extend ntp-client /usr/local/librenms/ntp-client.sh +#SMTP +extend mailq /usr/local/librenms/postfix-queues +#Distro Detection +extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/librenms/distro +#extend zfs /usr/local/bin/zfs +extend osupdate /usr/local/librenms/os-updates.sh diff --git a/main.cf b/main.cf new file mode 100644 index 0000000..7e63b24 --- /dev/null +++ b/main.cf @@ -0,0 +1,48 @@ +# See /usr/share/postfix/main.cf.dist for a commented, more complete version + + +# Debian specific: Specifying a file name will cause the first +# line of that file to be used as the name. The Debian default +# is /etc/mailname. +#myorigin = /etc/mailname + +smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) +biff = no + +# appending .domain is the MUA's job. +append_dot_mydomain = no + +# Uncomment the next line to generate "delayed mail" warnings +#delay_warning_time = 4h + +readme_directory = no + +# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on +# fresh installs. +compatibility_level = 2 + + + +# TLS parameters +smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem +smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key +smtpd_tls_security_level=may + +smtp_tls_CApath=/etc/ssl/certs +smtp_tls_security_level=may +smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache + + +smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination +myhostname = pfv-vpn.turnsys.net +alias_maps = hash:/etc/aliases +alias_database = hash:/etc/aliases +myorigin = /etc/mailname +mydestination = pfv-vpn.turnsys.net, $myhostname, pfv-vpn, localhost.localdomain, localhost +relayhost = pfv-toolbox.turnsys.net +mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 +mailbox_size_limit = 0 +recipient_delimiter = + +inet_interfaces = all +inet_protocols = all + diff --git a/netdata-stream.conf b/netdata-stream.conf new file mode 100644 index 0000000..0d39baf --- /dev/null +++ b/netdata-stream.conf @@ -0,0 +1,5 @@ +[stream] + enabled = yes + destination = pfv-toolbox.turnsys.net:19999 + api key = 6ed9e20a-c819-4ebc-b894-322eb0710d03 + diff --git a/newSrv.sh b/newSrv.sh new file mode 100644 index 0000000..480ed7f --- /dev/null +++ b/newSrv.sh @@ -0,0 +1,256 @@ +#!/bin/bash + + +# Standard strict mode and error handling boilderplate... + +set -eEu +set -o pipefail +set -o functrace + +export PS4='(${BASH_SOURCE}:${LINENO}): - [${SHLVL},${BASH_SUBSHELL},$?] $ ' + +function handle_failure() { + local lineno=$2 + local fn=$3 + local exitstatus=$4 + local msg=$5 + local lineno_fns=${1% 0} + if [[ "$lineno_fns" != "0" ]] ; then + lineno="${lineno} ${lineno_fns}" + fi + echo "${BASH_SOURCE[1]}: Function: ${fn} Line Number : [${lineno}] Failed with status ${exitstatus}: $msg" +} + +trap 'handle_failure "${BASH_LINENO[*]}" "$LINENO" "${FUNCNAME[*]:-script}" "$?" "$BASH_COMMAND"' ERR + + +# Start actual script logic here... + + +function global-configureAptRepos() + +{ + +echo "Now running $FUNCNAME...." + +echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list +curl --insecure -s https://www.webmin.com/jcameron-key.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/jcameron-key.gpg + +echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" > /etc/apt/sources.list.d/cisofy-lynis.list +curl --insecure -s https://packages.cisofy.com/keys/cisofy-software-public.key | apt-key add - + + +echo "Completed running $FUNCNAME" + +} + +function global-shellScripts() + +{ + +echo "Now running $FUNCNAME...." + +curl -s http://dl.turnsys.net/distro > /usr/local/bin/distro ; chmod +x /usr/local/bin/distro +curl -s http://dl.turnsys.net/upsnotify.sh > /usr/local/bin/upsnotify.sh ; chmod +x /usr/local/bin/upsnotify.sh +curl -s http://dl.turnsys.net/up2date.sh > /usr/local/bin/up2date.sh ; chmod +x /usr/local/bin/up2date.sh + +echo "Completed running $FUNCNAME" + +} + +function global-profileScripts() +{ + +echo "Now running $FUNCNAME...." + +curl -s http://dl.turnsys.net/profiled-tsys-shell.sh > /etc/profile.d/tsys-shell.sh +curl -s http://dl.turnsys.net/profiled-tmux.sh > /etc/profile.d/tmux.sh +curl -s http://dl.turnsys.net/profiled-notify-discord.sh > /etc/profile.d/login-notify-discord.sh + +echo "Completed running $FUNCNAME" + +} + + +function global-oam() + +{ + +echo "Now running $FUNCNAME...." + +rm -rf /usr/local/librenms-agent +curl -s http://dl.turnsys.net/librenms.tar.gz > /usr/local/librenms.tar.gz +cd /usr/local ; tar xfz librenms.tar.gz ; rm -f /usr/local/librenms.tar.gz + +echo "Completed running $FUNCNAME" + +} + + +if [[ ! -f /root/ntpserver ]]; then +curl -s http://dl.turnsys.net/ntp.conf > /etc/ntp.conf +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install ntp ntpdate +systemctl stop ntp ; ntpdate pfv-dc-02.turnsys.net ; systemctl start ntp +fi + +function global-systemServiceConfigurationFiles() + +{ + +echo "Now running $FUNCNAME...." + + +curl -s http://dl.turnsys.net/aliases > /etc/aliases +curl -s http://dl.turnsys.net/rsyslog.conf > /etc/rsyslog.conf +#curl -s http://dl.turnsys.net/resolv.conf > /etc/resolv.conf +curl -s http://dl.turnsys.net/nsswitch.conf > /etc/nsswitch.conf + + +if [ ! -d /root/.ssh ]; then +mkdir /root/.ssh/ +fi +curl -s http://dl.turnsys.net/ssh-authorized-keys > /root/.ssh/authorized_keys ; chmod 400 /root/.ssh/authorized_keys + +echo "Completed running $FUNCNAME" + +} + +function global-installPackages() + +{ + +echo "Now running $FUNCNAME...." + +# +#Ensure system time is correct, otherwise can't install packages... +# + + + +# +#Patch the system +# + +/usr/local/bin/up2date.sh + +# +#Remove stuff we don't want, add stuff we do want +# + +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" --purge remove nano + +MAIL_HOST="$(hostname -f)" +debconf-set-selections <<< "postfix postfix/mailname string $MAIL_HOST" +debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet with smarthost'" +debconf-set-selections <<< "postfix postfix/relayhost string 'pfv-toolbox.turnsys.net'" + +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install \ +htop \ +dstat \ +snmpd \ +ncdu \ +iftop \ +acct \ +glances \ +nethogs \ +sysstat \ +ngrep \ +lsb-release \ +screen \ +tmux \ +lldpd \ +net-tools \ +gpg \ +molly-guard \ +lshw \ +sudo \ +mailutils \ +clamav \ +sl \ +rsyslog \ +logwatch \ +git \ +rsync \ +tshark \ +tcpdump \ +lynis \ +qemu-guest-agent \ +zsh \ +sssd \ +sssd-ad \ +krb5-user \ +samba \ +autofs \ +adcli \ +telnet \ +postfix \ +webmin + + +bash <(curl -Ss https://my-netdata.io/kickstart.sh) --dont-wait +curl -s http://dl.turnsys.net/netdata-stream.conf > /etc/netdata/stream.conf ; systemctl stop netdata ; systemctl start netdata + +echo "Completed running $FUNCNAME" + +} + +function global-postPackageConfiguration() + +{ + +echo "Now running $FUNCNAME...." + +###Post package deployment bits +systemctl stop snmpd ; /etc/init.d/snmpd stop +sed -i "s|-Lsd|-LS6d|" /lib/systemd/system/snmpd.service +curl -s http://dl.turnsys.net/snmpd.conf > /etc/snmp/snmpd.conf +systemctl daemon-reload ; systemctl restart snmpd ; /etc/init.d/snmpd restart + +/etc/init.d/rsyslog stop ; /etc/init.d/rsyslog start ; logger "hi hi from $(hostname)" + +systemctl restart ntp +systemctl restart postfix + +accton on + +echo "Completed running $FUNCNAME" + +} + +################################################## +# Things todo on all TSYS systems +################################################## + +#################################################################################################### +#Download configs and support bits to onfigure things in the TSYS standard model +#################################################################################################### + +global-configureAptRepos +global-shellScripts +global-profileScripts +global-oam +global-systemServiceConfigurationFiles + + +#################################################################################################### +#Install packages and preserve existing configs... +#################################################################################################### +global-installPackages +global-postPackageConfiguration + + +################################################## +# Things todo on certain types of systems +################################################## + +### +# Proxmox servers +### + +### +# Raspberry Pi +### + +### +# Jetson nano +### diff --git a/newSrv.sh.txt b/newSrv.sh.txt new file mode 100644 index 0000000..480ed7f --- /dev/null +++ b/newSrv.sh.txt @@ -0,0 +1,256 @@ +#!/bin/bash + + +# Standard strict mode and error handling boilderplate... + +set -eEu +set -o pipefail +set -o functrace + +export PS4='(${BASH_SOURCE}:${LINENO}): - [${SHLVL},${BASH_SUBSHELL},$?] $ ' + +function handle_failure() { + local lineno=$2 + local fn=$3 + local exitstatus=$4 + local msg=$5 + local lineno_fns=${1% 0} + if [[ "$lineno_fns" != "0" ]] ; then + lineno="${lineno} ${lineno_fns}" + fi + echo "${BASH_SOURCE[1]}: Function: ${fn} Line Number : [${lineno}] Failed with status ${exitstatus}: $msg" +} + +trap 'handle_failure "${BASH_LINENO[*]}" "$LINENO" "${FUNCNAME[*]:-script}" "$?" "$BASH_COMMAND"' ERR + + +# Start actual script logic here... + + +function global-configureAptRepos() + +{ + +echo "Now running $FUNCNAME...." + +echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list +curl --insecure -s https://www.webmin.com/jcameron-key.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/jcameron-key.gpg + +echo "deb https://packages.cisofy.com/community/lynis/deb/ stable main" > /etc/apt/sources.list.d/cisofy-lynis.list +curl --insecure -s https://packages.cisofy.com/keys/cisofy-software-public.key | apt-key add - + + +echo "Completed running $FUNCNAME" + +} + +function global-shellScripts() + +{ + +echo "Now running $FUNCNAME...." + +curl -s http://dl.turnsys.net/distro > /usr/local/bin/distro ; chmod +x /usr/local/bin/distro +curl -s http://dl.turnsys.net/upsnotify.sh > /usr/local/bin/upsnotify.sh ; chmod +x /usr/local/bin/upsnotify.sh +curl -s http://dl.turnsys.net/up2date.sh > /usr/local/bin/up2date.sh ; chmod +x /usr/local/bin/up2date.sh + +echo "Completed running $FUNCNAME" + +} + +function global-profileScripts() +{ + +echo "Now running $FUNCNAME...." + +curl -s http://dl.turnsys.net/profiled-tsys-shell.sh > /etc/profile.d/tsys-shell.sh +curl -s http://dl.turnsys.net/profiled-tmux.sh > /etc/profile.d/tmux.sh +curl -s http://dl.turnsys.net/profiled-notify-discord.sh > /etc/profile.d/login-notify-discord.sh + +echo "Completed running $FUNCNAME" + +} + + +function global-oam() + +{ + +echo "Now running $FUNCNAME...." + +rm -rf /usr/local/librenms-agent +curl -s http://dl.turnsys.net/librenms.tar.gz > /usr/local/librenms.tar.gz +cd /usr/local ; tar xfz librenms.tar.gz ; rm -f /usr/local/librenms.tar.gz + +echo "Completed running $FUNCNAME" + +} + + +if [[ ! -f /root/ntpserver ]]; then +curl -s http://dl.turnsys.net/ntp.conf > /etc/ntp.conf +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install ntp ntpdate +systemctl stop ntp ; ntpdate pfv-dc-02.turnsys.net ; systemctl start ntp +fi + +function global-systemServiceConfigurationFiles() + +{ + +echo "Now running $FUNCNAME...." + + +curl -s http://dl.turnsys.net/aliases > /etc/aliases +curl -s http://dl.turnsys.net/rsyslog.conf > /etc/rsyslog.conf +#curl -s http://dl.turnsys.net/resolv.conf > /etc/resolv.conf +curl -s http://dl.turnsys.net/nsswitch.conf > /etc/nsswitch.conf + + +if [ ! -d /root/.ssh ]; then +mkdir /root/.ssh/ +fi +curl -s http://dl.turnsys.net/ssh-authorized-keys > /root/.ssh/authorized_keys ; chmod 400 /root/.ssh/authorized_keys + +echo "Completed running $FUNCNAME" + +} + +function global-installPackages() + +{ + +echo "Now running $FUNCNAME...." + +# +#Ensure system time is correct, otherwise can't install packages... +# + + + +# +#Patch the system +# + +/usr/local/bin/up2date.sh + +# +#Remove stuff we don't want, add stuff we do want +# + +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" --purge remove nano + +MAIL_HOST="$(hostname -f)" +debconf-set-selections <<< "postfix postfix/mailname string $MAIL_HOST" +debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet with smarthost'" +debconf-set-selections <<< "postfix postfix/relayhost string 'pfv-toolbox.turnsys.net'" + +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes -o Dpkg::Options::="--force-confold" install \ +htop \ +dstat \ +snmpd \ +ncdu \ +iftop \ +acct \ +glances \ +nethogs \ +sysstat \ +ngrep \ +lsb-release \ +screen \ +tmux \ +lldpd \ +net-tools \ +gpg \ +molly-guard \ +lshw \ +sudo \ +mailutils \ +clamav \ +sl \ +rsyslog \ +logwatch \ +git \ +rsync \ +tshark \ +tcpdump \ +lynis \ +qemu-guest-agent \ +zsh \ +sssd \ +sssd-ad \ +krb5-user \ +samba \ +autofs \ +adcli \ +telnet \ +postfix \ +webmin + + +bash <(curl -Ss https://my-netdata.io/kickstart.sh) --dont-wait +curl -s http://dl.turnsys.net/netdata-stream.conf > /etc/netdata/stream.conf ; systemctl stop netdata ; systemctl start netdata + +echo "Completed running $FUNCNAME" + +} + +function global-postPackageConfiguration() + +{ + +echo "Now running $FUNCNAME...." + +###Post package deployment bits +systemctl stop snmpd ; /etc/init.d/snmpd stop +sed -i "s|-Lsd|-LS6d|" /lib/systemd/system/snmpd.service +curl -s http://dl.turnsys.net/snmpd.conf > /etc/snmp/snmpd.conf +systemctl daemon-reload ; systemctl restart snmpd ; /etc/init.d/snmpd restart + +/etc/init.d/rsyslog stop ; /etc/init.d/rsyslog start ; logger "hi hi from $(hostname)" + +systemctl restart ntp +systemctl restart postfix + +accton on + +echo "Completed running $FUNCNAME" + +} + +################################################## +# Things todo on all TSYS systems +################################################## + +#################################################################################################### +#Download configs and support bits to onfigure things in the TSYS standard model +#################################################################################################### + +global-configureAptRepos +global-shellScripts +global-profileScripts +global-oam +global-systemServiceConfigurationFiles + + +#################################################################################################### +#Install packages and preserve existing configs... +#################################################################################################### +global-installPackages +global-postPackageConfiguration + + +################################################## +# Things todo on certain types of systems +################################################## + +### +# Proxmox servers +### + +### +# Raspberry Pi +### + +### +# Jetson nano +### diff --git a/nsswitch.conf b/nsswitch.conf new file mode 100644 index 0000000..b45fabc --- /dev/null +++ b/nsswitch.conf @@ -0,0 +1,22 @@ +# +# Example configuration of GNU Name Service Switch functionality. +# If you have the `glibc-doc-reference' and `info' packages installed, try: +# `info libc "Name Service Switch"' for information about this file. + +passwd: compat sss +group: compat sss +shadow: compat sss +gshadow: files + +hosts: files dns +networks: files + +protocols: db files +services: db files sss +ethers: db files +rpc: db files + +netgroup: nis sss +sudoers: files + + diff --git a/ntp.conf b/ntp.conf new file mode 100644 index 0000000..47d7a12 --- /dev/null +++ b/ntp.conf @@ -0,0 +1,6 @@ +driftfile /var/lib/ntp/ntp.drift +leapfile /usr/share/zoneinfo/leap-seconds.list +server 10.251.33.6 +server 10.251.33.7 +restrict 127.0.0.1 +restrict ::1 diff --git a/omsa.sh b/omsa.sh new file mode 100644 index 0000000..c309f8a --- /dev/null +++ b/omsa.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +#curl -s http://dl.turnsys.net/omsa.sh|/bin/bash + +gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 1285491434D8786F +gpg -a --export 1285491434D8786F | apt-key add - +echo "deb http://linux.dell.com/repo/community/openmanage/930/bionic bionic main" > /etc/apt/sources.list.d/linux.dell.com.sources.list +wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-curl-client-transport1_2.6.5-0ubuntu3_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-client4_2.6.5-0ubuntu3_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman1_2.6.5-0ubuntu3_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-server1_2.6.5-0ubuntu3_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfcc/libcimcclient0_2.2.8-0ubuntu2_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/openwsman_2.6.5-0ubuntu3_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/multiverse/c/cim-schema/cim-schema_2.48.0-0ubuntu1_all.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfc-common/libsfcutil0_1.0.1-0ubuntu4_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/multiverse/s/sblim-sfcb/sfcb_1.4.9-0ubuntu5_amd64.deb +wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-cmpi-devel/libcmpicppimpl0_2.0.3-0ubuntu2_amd64.deb +dpkg -i libwsman-curl-client-transport1_2.6.5-0ubuntu3_amd64.deb +dpkg -i libwsman-client4_2.6.5-0ubuntu3_amd64.deb +dpkg -i libwsman1_2.6.5-0ubuntu3_amd64.deb +dpkg -i libwsman-server1_2.6.5-0ubuntu3_amd64.deb +dpkg -i libcimcclient0_2.2.8-0ubuntu2_amd64.deb +dpkg -i openwsman_2.6.5-0ubuntu3_amd64.deb +dpkg -i cim-schema_2.48.0-0ubuntu1_all.deb +dpkg -i libsfcutil0_1.0.1-0ubuntu4_amd64.deb +dpkg -i sfcb_1.4.9-0ubuntu5_amd64.deb +dpkg -i libcmpicppimpl0_2.0.3-0ubuntu2_amd64.deb + +apt update +apt -y install srvadmin-all +touch /opt/dell/srvadmin/lib64/openmanage/IGNORE_GENERATION +/opt/dell/srvadmin/sbin/srvadmin-services.sh enable && /opt/dell/srvadmin/sbin/srvadmin-services.sh start && diff --git a/profiled-notify-discord.sh b/profiled-notify-discord.sh new file mode 100644 index 0000000..744dc4e --- /dev/null +++ b/profiled-notify-discord.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +WEBHOOK_URL="https://discord.com/api/webhooks/829537026285109278/8sxWSbvowBR_Lyf48c8UaUyppzOd9PdqTFkzSFBl9uEV1YnuB76WnbS1S0qT9kY6OuJf" +CLIENT_IP=$(echo $SSH_CONNECTION | awk '{print $1}') +MESSAGE="You aren't alone.... **$USER** has logged in to **$(hostname)** at $(date) from **$CLIENT_IP**" +JSON="{\"content\": \"$MESSAGE\"}" + +curl -d "$JSON" -H "Content-Type: application/json" "$WEBHOOK_URL" + diff --git a/profiled-tmux.sh b/profiled-tmux.sh new file mode 100644 index 0000000..8bd0650 --- /dev/null +++ b/profiled-tmux.sh @@ -0,0 +1,4 @@ +if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then + tmux a -t default || exec tmux new -s default && exit; +fi + diff --git a/profiled-tsys-shell.sh b/profiled-tsys-shell.sh new file mode 100644 index 0000000..d61f6ad --- /dev/null +++ b/profiled-tsys-shell.sh @@ -0,0 +1,3 @@ +set -o vi +export HISTTIMEFORMAT="%m/%d/%Y %T " + diff --git a/prox.sh b/prox.sh new file mode 100644 index 0000000..106007f --- /dev/null +++ b/prox.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +rm -f /etc/apt/sources.list.d/* +echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list +wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg +chmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg # optional, if you have a non-default umask +apt update && apt -y full-upgrade +apt-get -y install ifupdown2 ipmitool ethtool net-tools lshw + +curl -s http://dl.turnsys.net/newSrv.sh|/bin/bash + + + diff --git a/prox7.sh b/prox7.sh new file mode 100644 index 0000000..6836c8c --- /dev/null +++ b/prox7.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +rm -f /etc/apt/sources.list.d/* +echo "deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list +wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg +chmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg # optional, if you have a non-default umask +apt update && apt -y full-upgrade +apt-get -y install ifupdown2 ipmitool ethtool net-tools lshw + +#curl -s http://dl.turnsys.net/newSrv.sh|/bin/bash + + + diff --git a/resolv.conf b/resolv.conf new file mode 100644 index 0000000..f38e52a --- /dev/null +++ b/resolv.conf @@ -0,0 +1,4 @@ +nameserver 10.251.33.6 +nameserver 10.251.33.7 +domain turnsys.net +search turnsys.net diff --git a/rsyslog.conf b/rsyslog.conf new file mode 100644 index 0000000..f2da9f0 --- /dev/null +++ b/rsyslog.conf @@ -0,0 +1,17 @@ +# /etc/rsyslog.conf configuration file for rsyslog +# +# For more information install rsyslog-doc and see +# /usr/share/doc/rsyslog-doc/html/configuration/index.html + + +################# +#### MODULES #### +################# + +module(load="imuxsock") # provides support for local system logging +module(load="imklog") # provides kernel logging support +#module(load="immark") # provides --MARK-- message capability + +*.* @pfv-toolbox.turnsys.net:514 +EOF + diff --git a/snmpd.conf b/snmpd.conf new file mode 100644 index 0000000..bba0fcf --- /dev/null +++ b/snmpd.conf @@ -0,0 +1,40 @@ +########################################################################## +# snmpd.conf +# Created by CNW on 11/3/2018 via snmpconf wizard and manual post tweaks +########################################################################### +# SECTION: Monitor Various Aspects of the Running Host +# + +# disk: Check for disk space usage of a partition. +# The agent can check the amount of available disk space, and make +# sure it is above a set limit. +# +load 3 3 3 +rocommunity kn3lmgmt 10.251.37.1 +sysservices 76 + +#syslocation Rack, Room, Building, City, Country [Lat, Lon] +syslocation R5, Prod Center, HQ, Pflugervile, Unite States +syscontact prodtechopsalerts@turnsys.com + +#NTP +extend ntp-client /usr/local/librenms/ntp-client.sh + +#SMTP +extend mailq /usr/local/librenms/postfix-queues +extend postfixdetailed /usr/local/librenms/postfixdetailed + +#OS Distribution Detection +extend distro /usr/local/librenms/distro +extend osupdate /usr/local/librenms/os-updates.sh + + +#Hardware Detection +# (uncomment for x86 platforms) +extend manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor' +extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name' +extend serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial' + + +# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX +smuxpeer .1.3.6.1.4.1.674.10892.1 diff --git a/ssh-authorized-keys b/ssh-authorized-keys new file mode 100644 index 0000000..bd5277a --- /dev/null +++ b/ssh-authorized-keys @@ -0,0 +1,8 @@ +#Charles N Wyble ssh key (putty windows 10 surface) + +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnhDjA004vIMMIwFSFv5K0mj0avk997fVdiVtqoSMAAe/OabK/yuFNF3/LRMtWeTG8r859cmdvs+9z+l9jcXIDRgMVW+hR8exysk5JtQgGwSijdwYz9yRmoT3apNSvwFN0g0HkhAWLTQWmafTYCR9CQWJTfPWZN/ypW7Vm/ZHcl9UxLUnT6LWpOL7usEN4OLT6NRwQDaYOtR3OFm62UqIaIFQXAnMg0qbDICllpXatPWtlkN7CU6xHhSwD0GycuJbX1/KBNcQ4msoIMGCUaA8yTWZfqAg6KDE3ojoZJh1w14ABHZPb6imz5jzQEG6eOUVOAlKwv/Ry5RxNfP3Vz9Ld rsa-key-20210828 + + +#Librenms/openvas/rundeck key +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGIzki6Xxyyih5HWMXR/uWLGgJprDGEBWC3JX8G7562zcx3eKDl0GKmZv4cl0AZZUwLATvpks8w2Bk6BL7cDvgUkmgpawHgGeRCjLi19/gG8t6M7k+U/rw6uu5SeaFXy5q22zkkE2TDTotWsoa6NE59Gc5/dNgQkYC0r1adD/J2+A6XgxoHdAEVX7gkFhBhXJKTkCYgatDzyE1IUoWLYAQpnMPcBUwK/i7qrcrVYqz0IS6p3MuYYS1+hr1MbMd5bX+Gm6PB6zf/CKhJkUFvaYS+QkVCMzQKrxNRuCs7ULyYvvi9EfxcCow06LuYvslMpEMIfJp8zKX9rhlvu9tuOkF + diff --git a/sssd.conf b/sssd.conf new file mode 100644 index 0000000..62150f5 --- /dev/null +++ b/sssd.conf @@ -0,0 +1,15 @@ +[sssd] +services = nss, pam +config_file_version = 2 +domains = TURNSYS.NET + +[domain/TURNSYS.NET] +id_provider = ad +access_provider = ad +enumerate = true +ldap_id_mapping = true +krb5_validate = false +dns_discovery_domain = turnsys.net + +override_homedir = /home/%u +override_shell = /bin/bash diff --git a/up2date.sh b/up2date.sh new file mode 100644 index 0000000..5370536 --- /dev/null +++ b/up2date.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +echo "Running apt-get update" +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes update + +echo "Running apt-get dist-upgrade" +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes dist-upgrade + +echo "Running apt-get upgrade" +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --yes upgrade + + +echo "Running apt-get purge" +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq --purge autoremove --yes +export DEBIAN_FRONTEND="noninteractive" && apt-get -qq autoclean --yes +