eerste opzet
This commit is contained in:
41
DebianTweaks.sh
Executable file
41
DebianTweaks.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
#Set the correct mailer fqdn
|
||||
echo $(hostname -f) > /etc/mailname
|
||||
|
||||
#Add mailto address in crontab
|
||||
awk '/PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin/ { print; print "MAILTO=thomas@de-roo.org"; next }1' /etc/crontab > /tmp/crontab.temp
|
||||
cat /tmp/crontab.temp > /etc/crontab
|
||||
rm /tmp/crontab.temp
|
||||
|
||||
#Better logon-message
|
||||
figlet $(hostname)>/etc/motd
|
||||
|
||||
#SNMP things. N.B.: replace VULHIERDELOCATIEIN later
|
||||
cat > /etc/snmp/snmpd.conf << 'EOF'
|
||||
sysLocation VULHIERDELOCATIEIN
|
||||
sysContact Thomas de Roo <thomas@de-roo.org>
|
||||
rocommunity cacti
|
||||
rocommunity librenms
|
||||
includeAllDisks 10%
|
||||
|
||||
#OS Distribution Detection
|
||||
extend distro /usr/bin/distro
|
||||
|
||||
#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'
|
||||
|
||||
# (uncomment for ARM platforms)
|
||||
#extend hardware '/bin/cat /sys/firmware/devicetree/base/model'
|
||||
#extend serial '/bin/cat /sys/firmware/devicetree/base/serial-number'
|
||||
EOF
|
||||
|
||||
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
|
||||
chmod a+x /usr/bin/distro
|
||||
echo @reboot root chmod 444 /sys/devices/virtual/dmi/id/product_serial >> /etc/crontab
|
||||
chmod 444 /sys/devices/virtual/dmi/id/product_serial
|
||||
systemctl restart snmpd
|
||||
Reference in New Issue
Block a user