Posted on May 22, 2017 4:16 pm
 |  Asked by Nick Avgerinos
 |  1035 views
0
0
Print Friendly, PDF & Email

I’m relatively new to EOS, so I feel like I’m probably missing a basic step.

I’ve setup a vEOS testlab, running under KVM.  Most things have been going well, the virtual switches can see each other, i’ve been able to test some ZTP scripts.

I’m getting stuck however when it comes to running an agent using the python sdk.  I’m attempting to start the HelloWorld.py from this example (https://github.com/aristanetworks/EosSdk/wiki/Quickstart:-Hello-World)

However, all I get when looking at the agent logs is “waiting for connection to Sysdb …..” and it never connects.

veos-vdf-core1#configure
veos-vdf-core1(config)#daemon HelloWorldAgent
veos-vdf-core1(config-daemon-HelloWorldAgent)#show active
daemon HelloWorldAgent
   exec /mnt/flash/HelloWorld.py
   no shutdown
veos-vdf-core1(config-daemon-HelloWorldAgent)#
veos-vdf-core1(config-daemon-HelloWorldAgent)#shutdown
veos-vdf-core1(config-daemon-HelloWorldAgent)#no shutdown
This is an EosSdk application
Full agent name is 'HelloWorld-HelloWorldAgent'
! Standard profile name '/usr/lib/SysdbMountProfiles/HelloWorld.py' not found

The /var/log/agents/HelloWorld-HelloWorldAgent-XXXX log file looks like:
===== Output from /mnt/flash/HelloWorld.py [] (PID=6090) started May 12 12:24:51.489417 ===
2017-05-12 12:24:51.718989 Using external Socket tbl://sysdb/+n
2017-05-12 12:24:51.719141 Using externally set fd: 7
waiting for connection to Sysdb ...........................................


I can do a "ps" and verify there is a Sysdb process running.  Is there something I need to do to enable the agent to talk to it?
0
Posted by Tamas Plugor
Answered on May 25, 2017 10:00 am

Hey Nick,

Since 4.16 you need to install a mount profile into /usr/lib/SysdbMountProfiles, without it you will get the error you are seeing the the waiting for connection to Sysdb log

a simple way to create a mount profile would be the following:

bin=/mnt/flash/HelloWorld.py # <<<=== adapt this line if needed
name=$(basename $bin)
dest=/usr/lib/SysdbMountProfiles/$name
source="/usr/lib/SysdbMountProfiles/EosSdkAll"
cat $source | sed "1s/agentName[ ]*:.*/agentName:${name}-%sliceId/" > /tmp/tmp_$name
delta=$(cmp /tmp/tmp_$name $source)
if [ "$?" = "0" ]; then
  echo "Error: something is wrong"
else
  sudo mv /tmp/tmp_$name $dest
fi
[admin@co148 ~]$ bin=/mnt/flash/HelloWorld.py
[admin@co148 ~]$ name=$(basename $bin)
[admin@co148 ~]$ dest=/usr/lib/SysdbMountProfiles/$name
[admin@co148 ~]$ source=”/usr/lib/SysdbMountProfiles/EosSdkAll”
[admin@co148 ~]$ cat $source | sed “1s/agentName[ ]*:.*/agentName:${name}-%sliceId/” > /tmp/tmp_$name
[admin@co148 ~]$ delta=$(cmp /tmp/tmp_$name $source)
[admin@co148 ~]$ if [ “$?” = “0” ]; then
>   echo “Error: something is wrong”
> else
>   sudo mv /tmp/tmp_$name $dest
> fi
[admin@co148 ~]$ exit
logout
 
co148…09:55:56(config-daemon-HelloWorldAgent)#sho dae
Agent: HelloWorldAgent (running)
No configuration options stored.
 
Status:
Data           Value
————– —————————
greeting       Welcome! What is your name?

———————————————————————————

You can find more detailed info on our github page for EosSDK on: https://github.com/aristanetworks/EosSdk/wiki/Quickstart%3A-Hello-World

Hope this helps,

Thanks!

Tamas

Post your Answer

You must be logged in to post an answer.