Introduction
This document describes how to display external script messages to the Cisco Call Manager (CCM) deployment screen.
How to Input Script Messages to CCM Deployment Screen?
A. CloudCenter helps users to allow the deployment of service scripts and print the script message to deployment screen. The steps are described in a very simple script, hence you can use this sample script to create your own script message and output the desired message to the deployment screen.
Step 1. The very first step is to alter your script to have the logging feature.
Add this line to your script to include the CliQr agent utility:. /usr/local/osmosix/service/utils/agent_util.sh. The outcome of the sample script would be:
#!/bin/bash
. /usr/local/osmosix/service/utils/agent_util.sh
Step 2. Add agentSendLogMessage to the script with your custom message that you want to be displayed in CCM deployment screen.
#!/bin/bash
. /usr/local/osmosix/service/utils/agent_util.sh
agentSendLogMessage “SCRIPT MESSAGE: copying profile”
sudo cp /etc/profile /etc/profile_backup
If you want to use this on a windows machine, you would include this in your script instead: c:\Program Files\osmosix\service\utils\agent_util.ps1.
Step 3. Save the script and upload it to your local repository where the application is accessible to download the script to the deployed Virtual Machine (VM).
Step 4. Edit Application Profile. Navigate to Topology > Node Initialization & Clean Up > Initialization script. Link the script under Initialization Script as shown in the image.
Step 5. Deploy the Application.
The sample script used in this deployment:
#!/bin/bash
. /usr/local/osmosix/service/utils/agent_util.sh
log=/tmp/java.log
download=`wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo`
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
agentSendLogMessage “SCRIPT MESSAGE: copying profile”
sudo cp /etc/profile /etc/profile_backup
agentSendLogMessage “SCRIPT MESSAGE: Installing JAVA-1.8.0”
sudo yum install -y java-1.8.0-openjdk.x86_64 > $log
echo java -version > $log
sudo yum install -y wget > $log
agentSendLogMessage “SCRIPT MESSAGE: exporting java_home”
echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' | sudo tee -a /etc/profile
echo 'export JRE_HOME=/usr/lib/jvm/jre' | sudo tee -a /etc/profile
source /etc/profile
agentSendLogMessage “SCRIPT MESSAGE: Installing jenkins“
yum install -y jenkins
cd /usr/lib/jenkins/
/etc/init.d/jenkins stop
agentSendLogMessage “SCRIPT MESSAGE: starting jenkins“
mv jenkins.war /tmp/jenkinsold.war
wget https://updates.jenkins-ci.org/download/war/1.624/jenkins.war
/etc/init.d/jenkins start
cat /var/lib/jenkins/secrets/initialAdminPassword
agentSendLogMessage “SCRIPT MESSAGE: enabling jenkins“
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service
The output of the script is as shown in the image.