diff --git a/domdownload.sh b/domdownload.sh index 024019d..6967757 100755 --- a/domdownload.sh +++ b/domdownload.sh @@ -121,6 +121,10 @@ PerfTimerLogSession() return 0 fi + # truncate log + tail -$PERF_MAX_LOG_LINES "$PERF_LOG_FILE" >> "$PERF_LOG_FILE.tmp" + mv -f "$PERF_LOG_FILE.tmp" "$PERF_LOG_FILE" + echo >> "$PERF_LOG_FILE" date '+%F %T' >> "$PERF_LOG_FILE" echo "--------------------" >> "$PERF_LOG_FILE" @@ -2153,9 +2157,13 @@ if [ -z "$PERF_MAX_CHECKSUM" ]; then PERF_MAX_CHECKSUM=5000 fi +if [ -z "$PERF_MAX_LOG_LINES" ]; then + PERF_MAX_LOG_LINES=100 +fi PERF_LOG_FILE=$DOMDOWNLOAD_CFG_DIR/domdownload.perf + if [ ! -e "$DOMDOWNLOAD_CFG_DIR" ]; then LogMessage "Info: Creating configuration directory: $DOMDOWNLOAD_CFG_DIR" mkdir -p "$DOMDOWNLOAD_CFG_DIR" diff --git a/snmp/dominosnmp.service b/snmp/dominosnmp.service new file mode 100644 index 0000000..a556690 --- /dev/null +++ b/snmp/dominosnmp.service @@ -0,0 +1,32 @@ +########################################################################### +# systemd Service - Start/Stop Script for HCL Domino SNMP Agent # +# Version 1.0.0 09.11.2023 # +# # +# (C) Copyright Daniel Nashed/NashCom 2023 # +# Feedback domino_unix@nashcom.de # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# +# See the License for the specific language governing permissions and # +# limitations under the License. # +########################################################################### + +[Unit] + +Description=HCL Domino SNMP Agent +After=syslog.target network.target + +[Service] +Type=forking +ExecStart=/opt/hcl/domino/notes/latest/linux/lnsnmp -F + +[Install] +WantedBy=multi-user.target + diff --git a/snmp/install.sh b/snmp/install.sh new file mode 100755 index 0000000..d486199 --- /dev/null +++ b/snmp/install.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +DOMINO_SNMP_SYSTEMD_NAME=dominosnmp +DOMINO_SNMP_SYSTEMD_FILE=$DOMINO_SNMP_SYSTEMD_NAME.service +DOMINO_SNMP_SYSTEMD_FILEPATH=/etc/systemd/system/$DOMINO_SNMP_SYSTEMD_FILE +SNMPD_CONF=/etc/snmp/snmpd.conf + + +log () +{ + echo + echo "$@" + echo +} + +log_error() +{ + log "$@" + exit 1 +} + + +if [ ! -e "$SNMPD_CONF" ]; then + log_error "SNMP Agent not installed" +fi + +if [ -n "$(grep "smuxpeer 1.3.6.1.4.1.334.72" "$SNMPD_CONF")" ]; then + log "Domino SNMP settings already set in $SNMPD_CONF" + +else + echo >> "$SNMPD_CONF" + echo "# Allow HCL Domino SNMP SMUX (lnsnmp)" >> "$SNMPD_CONF" + echo "smuxpeer 1.3.6.1.4.1.334.72 NotesPasswd" >> "$SNMPD_CONF" + echo >> "$SNMPD_CONF" + + systemctl restart snmpd +fi + + +cp $DOMINO_SNMP_SYSTEMD_FILE $DOMINO_SNMP_SYSTEMD_FILEPATH +chown root:root $DOMINO_SNMP_SYSTEMD_FILEPATH +chmod 644 $DOMINO_SNMP_SYSTEMD_FILEPATH + +systemctl daemon-reload +systemctl enable $DOMINO_SNMP_SYSTEMD_NAME + +log "Starting Domino SNMP agent..." + +systemctl restart $DOMINO_SNMP_SYSTEMD_NAME +systemctl status $DOMINO_SNMP_SYSTEMD_NAME + +log "Note: Ensure that the quryset and intrcpt server tasks are started on your Domino server" +