You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
switch# bash
[admin@switch]$ cd /mnt/flash
[admin@switch flash]$ cat >mountprofile.sh <<EOF
#!/bin/sh
if [ -z $1 ]; then
echo "Please specify an agent name"
exit 1
fi
AGENT=$1
DEST=/usr/lib/SysdbMountProfiles/$AGENT
SOURCE="/usr/lib/SysdbMountProfiles/EosSdkAll"
TMP=/tmp/tmp_$AGENT
cat $SOURCE | sed "1s/agentName[ ]*:.*/agentName:${AGENT}-%sliceId/" > $TMP
delta=$(cmp /tmp/tmp_$AGENT $SOURCE)
if [ "$?" = "0" ]
then
echo "Error: something is wrong"
exit 1
else
sudo mv $TMP $DEST
fi
EOF
Run the mount profile script
[admin@switch flash]$
[admin@switch flash]$ sh mountprofile.sh HelloWorld
configure the daemon/agent on the switch
host# ssh -l admin <switch>
switch# configure
switch (configure)# daemon HelloWorld
switch (config-daemon-HelloWorld)# exec /mnt/flash/HelloWorld
switch (config-daemon-HelloWorld)# no shutdown
switch (config-daemon-HelloWorld)# show daemon HelloWorld
Agent: HelloWorld (running with PID 15711)
Uptime: 0:00:02 (Start time: Fri Nov 13 22:03:55 2020)
No configuration options stored.
Status:
Data Value
-------------- ---------------------------
greeting Welcome! What is your name?
switch (config-daemon-HelloWorld)# option name set Rupesh
switch (config-daemon-HelloWorld)# show daemon HelloWorld
Agent: HelloWorld (running with PID 15255)
Uptime: 0:04:32 (Start time: Fri Nov 13 21:58:29 2020)
Configuration:
Option Value
------------ ------
name Rupesh
Status:
Data Value
-------------- -------------
greeting Hello Rupesh!
switch (config-daemon-HelloWorld)# no option name
switch (config-daemon-HelloWorld)# show daemon HelloWorld
Agent: HelloWorld (running with PID 15255)
Uptime: 0:04:54 (Start time: Fri Nov 13 21:58:29 2020)
No configuration options stored.
Status:
Data Value
-------------- --------
greeting Goodbye!
switch (config-daemon-HelloWorld)# shutdown
switch (config-daemon-HelloWorld)# show daemon HelloWorld
Agent: HelloWorld (shutdown with PID 15255)
No configuration options stored.
Status:
Data Value
-------------- ------
greeting Adios!