NOTE: For cluster setups you can synchronize the configuration to the other node if you check Monit System Monitoring under System->High Availabilty->Settings. Then go to Firewall->Diagnostics->Filter Reload and click on Force Config Sync.
System 'firewall.example.com' status Running monitoring status Monitored monitoring mode active on reboot start load average [0.59] [0.41] [0.35] cpu 0.2%us 0.9%sy memory usage 2.6 GB [8.1%] swap usage 0 B [0.0%] uptime 20d 4h 25m boot time Thu, 18 May 2017 13:27:11 data collected Wed, 07 Jun 2017 17:51:23Filesystem 'RootFs' status Does not exist monitoring status Monitored monitoring mode active on reboot start data collected Wed, 07 Jun 2017 17:51:23Program 'IPMI' status Status ok monitoring status Monitored monitoring mode active on reboot start last exit value 0 last output System Health: OK, Power Meter: 174 Watts, Ambient Temp: 19 degrees C, Fans: 39 percent data collected Wed, 07 Jun 2017 17:51:23
pkg install ipmitoolkldload ipmiecho 'ipmi_load="YES"' >>/boot/loader.conf.local
#!/bin/cshset Status = 0set FanCount = 0set FanSum = 0foreach Line (`/usr/local/bin/ipmitool sdr list | sed 's/ /\\t/g'`) set SensorData = `echo $Line | sed 's/\\t/ /g'` set SensorName = `echo $SensorData | awk -F\| '{print $1}'` set SensorValue = `echo $SensorData | awk -F\| '{print $2}'` set SensorStatus = `echo $SensorData | awk -F\| '{print $3}'` if ( "$SensorStatus" != "ok" && "$SensorValue" != "disabled" ) then echo "$SensorData" set Status = 1 endif if ( "$SensorName" =~ "Power Supply*" ) then if ( "$SensorValue" == "0 Watts" ) then echo "$SensorData" set Status = 1 endif endif if ( "$SensorName" == "Power Meter" ) set PowerMeter = "$SensorValue" if ( "$SensorName" == "Temp 1" ) set AmbientTemp = "$SensorValue" if ( "$SensorName" =~ "Fan *" ) then @ FanCount = ( $FanCount + 1 ) set FanValue = `echo $SensorValue | awk '{print $1}' | awk -F. '{print $1}'` @ FanSum = ( $FanSum + $FanValue ) endifendif ( $Status == 0 ) then @ FanSpeed = ( $FanSum / $FanCount ) echo "System Health: OK, Power Meter: $PowerMeter, Ambient Temp: $AmbientTemp, Fans: $FanSpeed percent"endifexit $Status
chmod +x /usr/local/bin/CheckIPMI.sh
content = "(Registry 'virus_scan::engines' does not exist)|(clamd_connect: Can not connect to clamd server)" for 2 cycles
Service-Type: FILE
Path: /var/log/c-icap/server.log
#!/bin/sh/usr/local/etc/rc.d/clamav-clamd startsleep 5/usr/local/etc/rc.d/c-icap restart
#!/bin/cshset MaxCPUTemp = $1set NumCPUs = `sysctl -n kern.smp.cpus`set CurrentCPU = 0while ( $CurrentCPU < $NumCPUs ) set CPUTemp = `sysctl dev.cpu.$CurrentCPU.temperature | awk '{print $2}' | awk -F. '{print $1}'` echo "CPU $CurrentCPU temp: $CPUTemp" if ( $CPUTemp >= $MaxCPUTemp ) then exit $CPUTemp endif @ CurrentCPU = $CurrentCPU + 1endexit $CPUTemp
#!/bin/cshset FILE = "/var/dhcpd/var/db/dhcpd.leases"set LeaseCount = `grep -c "binding state active" $FILE`echo "Active LeaseCount: $LeaseCount"if ($LeaseCount > 0) then set LINE = ( `grep -n "binding state active" $FILE | cut -d: -f1` ) foreach L ($LINE) echo "##################" # set EL = `expr $L + 8` set CL = `expr $L - 5` while ( $CL < `expr $L + 8` ) if ( `sed -n "$CL p" $FILE | cut -d ' ' -f1` == "lease" ) then echo IP: `sed -n "$CL p" $FILE | cut -d ' ' -f2` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f3` == "starts" ) then echo Start: `sed -n "$CL p" $FILE | cut -d ' ' -f5,6` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f3` == "ends" ) then echo Ende: `sed -n "$CL p" $FILE | cut -d ' ' -f5,6` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f3` == "hardware" ) then echo MAC: `sed -n "$CL p" $FILE | cut -d ' ' -f5` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f3` == "client-hostname" ) then echo Name: `sed -n "$CL p" $FILE | cut -d ' ' -f4-` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f3` == "set" ) then echo Device: `sed -n "$CL p" $FILE | cut -d ' ' -f6-` endif if ( `sed -n "$CL p" $FILE | cut -d ' ' -f1` == "}" && $CL > $L ) then set CL = `expr $CL + 8` endif @ CL++ end end exit 1else exit 0endif