Skip to content

Commit

Permalink
changes to download script and first version of snmp service
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Nashed committed Nov 21, 2023
1 parent 81d3cb2 commit 7f5cc3d
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
8 changes: 8 additions & 0 deletions domdownload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
32 changes: 32 additions & 0 deletions snmp/dominosnmp.service
Original file line number Diff line number Diff line change
@@ -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

53 changes: 53 additions & 0 deletions snmp/install.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 7f5cc3d

Please sign in to comment.