-
Notifications
You must be signed in to change notification settings - Fork 73
Simulation Service Developer Reference Guide
- Go to
Azure portal > [your resource group] > Network Security Group > Inbound security rules
. - Select "SSH"
- Change action to "Allow" and save.
In order to access the VM, you will need to set a username and password for your VM.
- Go to
Azure portal > [your resource group] > Virtual Machine > reset password
. - Enter a new username and password.
-
Find your VM's IP address from the Azure Portal.
- Go to
Azure portal > [your resource group] > Virtual Machine > Overview
. The address will be listed in the top panel. - You can also select "Connect" from your VM's portal page which will display your ssh command.
- Go to
-
Sign into a VM.
- Open a bash window.
- If using Windows Command Prompt, you can enable bash with the instructions here
- To sign into a VM using bash, use your username (from above) followed by the IP address of the VM and enter your sign in credentials.
ssh myusername@12.34.567.890
- Open a bash window.
-
Open a bash window.
-
Navigate to the
/app
foldercd /app
-
Run the logs.sh script.
sudo ./logs.sh
-
This will show you the real-time log output of all running services.
- Open a bash terminal.
- SSH into the VM using the instructions above in SSH into a VM
- Find your container name or id with
docker ps
. - Write the logs for a container to disk:
docker logs <containerid> >& simlog.log
- Ensure the log data is present:
sudo nano container.log
- Open a second bash terminal on your local machine.
- Copy the file local:
scp <username>@<vm ip>:container.log c:/temp/container.log
- Open a bash terminal.
- SSH into the VM using the instructions above in SSH into a VM
- Navigate to the
/app
folder and edit the environment variables file.cd /app sudo nano env-vars
- Add the following line to the environment variables file. Supported values are ["Debug", "Info", "Warn", "Error"].
export PCS_LOG_LEVEL="[your log level choice]"
- Press control+X to exit and save the file
- Restart the service with the new log level with:
sudo ./start.sh
-
Go to
Azure portal > [your resource group] > IotHub > Metrics
. -
Select the values that you'd like to view. For example, connected devices, messages sent, etc...
-
If you just started your simulation you may need to wait a few minutes for the devices to show up in the portal.
If you have a Remote Monitoring V2 deployment, you can enter the hub connection string for the hub from the Remote Monitoring deployment instead of the one deployed with Device Simulation.
Using an RMv2 Hub works well and allows you to see the data show up in the RMv2 dashboard.