Welcome to FreeSoftwareServers Confluence Wiki

ClusterMon-HTML View

Both nodes:

cat << 'EOL'>/usr/local/bin/crm_logger.sh
logger -t "ClusterMon-External" "${CRM_notify_node} ${CRM_notify_rsc} \
${CRM_notify_task} ${CRM_notify_desc} ${CRM_notify_rc} \
${CRM_notify_target_rc} ${CRM_notify_status} ${CRM_notify_recipient}";
chmod 700 /usr/local/bin/crm_logger.sh
chown root.root /usr/local/bin/crm_logger.sh
cat << 'EOL'> /usr/local/bin/chmod.sh
chmod 777 /usr/local/bin/cluster_mon.html
chmod 700 /usr/local/bin/chmod.sh
chown root.root /usr/local/bin/chmod.sh
sh -c 'echo "*/1 * * * * root /usr/local/bin/chmod.sh > /dev/null 2>&1" >> /etc/crontab'

ONE node

pcs resource create ClusterMon-HTML ClusterMon user=root \
update=10 extra_options="-E /usr/local/bin/crm_logger.sh --watch-fencing" \
htmlfile=/usr/local/bin/cluster_mon.html \
pidfile=/var/run/crm_mon-external.pid clone

Symlink survives failover!*

ln -s /usr/local/bin/cluster_mon.html /var/www/html/clustermon.html
pcs constraint colocation add WWW-Group with ClusterMon-HTML-clone INFINITY

ClusterMon-SMTP - E-Mail Notifications

Both nodes:

cat << 'EOL'>/usr/local/bin/crm_e-mail.sh
echo "Please check your installation @ http://domain.com.com:2224 & http://domain.com.com/clustermon.html" | mail -s "Cluster Change Detected" sysalert@domain.com
chmod 700 /usr/local/bin/crm_e-mail.sh
chown root.root /usr/local/bin/crm_e-mail.sh

One Node :

pcs resource create ClusterMon-SMTP ClusterMon user=root \
update=10 extra_options="-E /usr/local/bin/crm_e-mail.sh --watch-fencing" \
pidfile=/var/run/crm_mon-smtp.pid clone
pcs constraint colocation add ClusterMon-HTML-clone with ClusterMon-SMTP-clone INFINITY
pcs resource delete ClusterMon-SMTP
  • No labels