SSM Agent Ping Status 'Connected' even when Raspberry pi is unplugged - amazon-web-services

I installed the ssm agent on my Pi Zero W (running Pi OS Lite). The device appears in the Fleet Manager/Managed instances. However, when I unplug it, it continues to show as connected for a good 5-10 minutes.
Is this indicative of some sort of problem with my config?
Is there any way I can change this frequency/make it realtime?

Related

GCP IoT connection in bizarre state

I have a Google IoT app that's been running well for quite a while. The devices send telemetry, and occasionally receive commands from the cloud.
One of my devices recently got into a state where it was connected and sending telemetry, which was being received just fine, but trying to send a commands to it resulted in a "that device is not connected" error. The console page for that device showed last error as "[9] mqtt: The connection broke or was closed by the client". I could not send commands either from my software or from the console. But the device was connected and sending telemetry just fine.
My device will recover from disconnections just fine--but if it is perfectly connected and running fine from its point of view, it has no reason to. And I can't tell it to reboot remotely because I can't send commands to it. If the device remains in this state, it essentially becomes an orphan.
My questions, then, are:
(1) How is it possible to get into this state, and is there any way for me to avoid it, or detect it from the firmware side so that I can reboot?
(2) Is there any way to fix this from the cloud side--to force a reconnection when I can't reach the device?
(3) Am I saved by the fact that my device will eventually disconnect and reconnect when the JWT expires? Will this "fix" the connection to be bidirectional?

Google Cloud Windows Server - Unable to launch a Command prompt

When attempting to forcely uninstall a software from the server, I switched off these two components from MSCONFIG.EXE:
MSConfig Screenshot
After rebooting the server, it doesn't respond anymore to RDP connections.
The Google Cloud Panel shows that the server is running, has an internal and external IP Address, but I cannot access it by any means. I already rebooted, stopped and started it many times.
This is the output for SERIAL PORT #1:
SeaBIOS (version 1.8.2-20181112_143635-google)
Total RAM Size = 0x00000000f0000000 = 3840 MiB
CPUs found: 1 Max CPUs supported: 1
found virtio-scsi at 0:3
virtio-scsi vendor='Google' product='PersistentDisk' rev='1' type=0 removable=0
virtio-scsi blksize=512 sectors=104857600 = 51200 MiB
drive 0x000f2a30: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=104857600
Booting from Hard Disk 0...
I am able to connect to SERIAL PORT #2, to try a deeper troubleshooting, but the first message after connection is this:
Computer is booting, SAC started and initialized
And when trying to open CMD command, this is the response:
SAC>cmd
Error: Unable to launch a Command Prompt. The service responsible for launching
Command Prompt channels has not yet registered. This may be because the
service is not yet started, is disabled by the administrator, is
malfunctioning or is unresponsive.
Does anyone know how to recover this server?
Thanks!
You unselected "Load system services". This means that nothing is loaded in Windows. The services that are required so that you can access the system remotely are not running.
You have two options:
Mount the disk on another Windows system, mount the registry and change the settings for these two items (I don't rember but this information is on the Internet). Then unmount the registry and create another VM with the disk.
Create a new instance and attach this disk as the second disk drive. Copy all the data from the second drive to the first drive. You will loose system settings, applications, etc but at least you can save your data.

Run application in Raspberry Pi with a web browser

I would like to build an application Raspberry Pi for controlling a 20 Inch monitor it will display some images.
Long story
Each user have an account (Web based application) and he/she is logged into account and upload some images/videos into his account (Stored AWS S3 buckets).
Later he can connect his Device it includes 20 Inch monitor+Raspberry Pi to this account.
Here the crucial part comes he can able to start some features on this monitor some of are
1.Set up an image slideshow in the monitor.
2.Can able to stop it.
3.Cache images for some times.
ie he/she control the monitor with a browser.
Currently we have Raspberry Pi 3 with RASPBIAN os and the user web application.
Is it possible to do with Raspberry Pi??

How to determine that an AWS EC2 instance is still initialising from a script

Is there a way to determine through a command line interface or other trick if an AWS EC2 instance is ready to receive ssh connections?
The running state seems not to be enough. Trying to connect in in the first minutes of the running state, the machine Status checks still shows initialising and ssh times out while trying to connect.
(I am using the awscli pip package.)
Running is similar to turning a computer on and finishing a bios check. As far as the hypervisor is concerned your instance is on.
The best way to know when your instance is ready, is to run a script at the end of startup (or when certain services are on) that will report its status to some other listener. Using that data, or event, you should know that your instance is ready to be connected to. This is purposely vague since there are so many different ways this can be accomplished.
You could also time the expected startup time, and try to connect after that and retry the connection if it fails. Still need a point at which you would stop trying as instances can fail to launch in some cases.

Can't rerun meteor leaderboard on AWS EC2 micro T1 instance after failing keepalive

I'm unable to run a Meteor leaderboard demo after a failed keepalive error on an AWS EC2 micro.T1 instance. If I start from a freshly booted Amazon Machine Instance (AMI) I'm able to run the leaderboard demo at localhost:3000 from Firefox when I'm connected with a VNC client (TightNVC Viewer). It runs very, very slowly, but it runs.
If I fail to interact with it soon enough however I get these messages
I2051-00:03:03.173(0)?Failed to receive keepalive! Exiting.
=> Exited with code:1
=> Meteor server restarted
From that point forward everything on that instance runs at a glacial pace. Switching back to the Firefox window takes 3 minutes. when I try to connect to //localhost:3000 Firefox I usually get a message about a script no longer running and eventually the terminal window adds this to what I wrote above:
I2051-00:06:02.443(0)?Failed to receive keepalive! Exiting.
=> Exited with code:1
=> Meteor server restarted
I2051-00:08:17.227(0)?Failed to receive keepalive! Exiting.
=> Exited with code:1
=> Your application is crashing. Waiting for file change.
Can anyone translate for me what is happening?
I'm wondering whether the t1.micro instance I'm running is just too under-powered or because it's not shutting down meteor properly thereby leaving an instance of MongoDB running and trying to launch another.
I'm using Amazon Machine Image ubuntu-precise-12.04-amd64-server-20130411.1 (ami-70f96e40) which says this about it's configuration:
Size: t1.micro
ECUs: up to 2
vCPUs: 1
Memory (GiB): 0.613
Instance Storage (GiB): EBS only
EBS-Optimized Available: -
Netw. Performance: -Very Low
Micro instances
Micro instances are a low-cost instance option, providing a small amount of CPU resources. They are suited for lower throughput applications, and websites that require additional compute cycles periodically, but are not appropriate for applications that require sustained CPU performance. Popular uses for micro instances include low traffic websites or blogs, small administrative applications, bastion hosts, and free trials to explore EC2 functionality.
If my guess is right, can anyone suggest an AMI suitable for Meteor development?
Thanks
check this answer
Try to remove meteor remove autopublish
How are you running the app on ec2? I have been able to run apps on a micro instance so I don't see why this should be an issue.
If you are running it by using 'meteor' as you would locally that's probably the issue. You get way better performance when running it as a node app, this typically isn't an issue when developing locally but may be too much for a ec2 micro.
What you want to do is 'meteor bundle example.tgz', upload that to the server and run it as a node app.
Here is a guide that I remember using a while ago to get it done on ec2:
http://julien-c.fr/2012/10/meteor-amazon-ec2/
You shouldn't need to use VNC either, you can access it from your own computer in a browser using the public address your instance gets assigned.
If you get a node fibers error message which is pretty common then cd into bundle/program/server do 'npm uninstall fibers' and then 'npm install fibers'