raspberry connection to router prevents script from running - raspberry-pi

I have a script on my raspberry that should get data from a site in the internet.
I want it to get this data as soon the raspberry boots up, so I added a line to the rc.local script to start my script, because according to the information I have this is the last init script to run. The my script runs in an infinite loop, so when I login it is supposed to be running but it is not. I made another script and added another line in the rc.local script start it too. My second script also runs in an infinite loop but it does not "talks" to the internet. After rebooting and logging in I found the my second script running but not my first.
The way I was connecting to my raspberry (in my working place):
the raspberry is connected to my router;
my local computer is also connected to the router;
the router is connecting to the internet;
Trying to find out what the problem is I brougth the raspberry to my house, but because I don't have a router there I connected the raspberry directly to my laptop. To my surprise when I logged in to the raspberry my to scripts were running.
So now I suppose that somehow the router connection (that is working very well with everything else) is stoping or preventing my first script from start.
Could anyone give me a hint to how I can prevent this problem or solve it?

Related

I'm not getting RX from a bluetooth PAN network I setup with my raspberry pi and another device. How can I debug?

I have one device that is bluetooth PAN capable and had success with a different raspberry pi. I think I messed up the configuration files on this new one but didn't change them before I enabled some process that I beleive created the pan0 network interface (seen in ifconfig). This is the guide I used "prog.world/raspberry-pi-pan" and I think I put in the wrong Address in /etc/systemd/network/pan0.network. I later tried to alter that interface with "ifconfig pan0 <actual IP 192.168 address that I assume is correct>. I tried to connect again and still am not recieving any info but I get confirmation that the connection is up and running on both sides. Could there be a way to restart or edit something to fix this? Look at the guide I mentioned above. Not sure how this all works after I make the config network files but it might have happened when I did the "sudo systemctl enable" command for systemd-networkd, bt-agent, and bt-network. Maybe there is another file I need to change the IP on?

Running a Sensu handler on the client instead of the server

I have the following problem: I am using sensu to monitor some raspberry pis. Im using standalone checks which works just fine. Now sometimes it might happen that one of the pis lost its wifi connection or just gets restarted manual and dhcp fails or for some other reason has no internet connection. The idea is to let the pi check it self for a internet connection and if the check fails it should solve the problem by it self like restarting wifi or reboot the pi.
Of course a simple bash script with a cronjob should do the job but I want to do the check with sensu. The problem is obvious if the check fails i don't have a internet connection and therefore can't send the check result to the sensu server.
Long story short ;) is it possible to implement something like the remediation feature just on the client? So that a handler on the client it self starts the script which should resolve the problem.
I don't think this is possible. Standalone checks are scheduled by the client but the check result us still published to the server. The result is then handled by the handler which resides on the server.
You could write a standalone "check" plugin which monitors the wifi and if it is off then it will turn it on. It isn't using a handler though.

Test Program in Delphi7 and XP on vmware, failed to connect socket

I try to run program in Delphi7 and XP as virtual machine, the program include client and server and requires socket connections, but every time I try to run it, always showing error message like below.
I have already opened the scktsrvr.exe and I'm sure the port is right at both sides. The program need call the local port.
What confused me is that I tried with same environment and operation with my real PC and it works fine.
So I have no idea why I just can't run the program in a virtual machine. Or is there anything I should do if I want to use socket connections in a virtual machine?
Have found root cause, because of the setting of my client program.
I should set the server IP as local IP of my client program so it can connect the server part.
It's nothing about the virtual machine at all, though I don't need to do previous action in the real machine.
Whatever it has been solved.

Win 10 IoT: WindowsIoTCoreWatcher.exe does not show my Raspberry PI device

I have a Raspberry PI with Win 10 IoT installed.
The device is connected through Ethernet, I can ping it
I've connected through Powershell, changed admin password. Followed instructions here: http://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
I can connect to the device's web based interface http://ip:8080
However, WindowsIoTCoreWatcher.exe does not show or list my device. I tried Refresh button, run as admin. Still no result.
How can I fix the issue?
Thank you,
WindowsIoTCoreWatcher listens for UDP broadcasts that are sent every five seconds by a process running on the device: C:\Windows\System32\ebootpinger.exe. It appears that this process occasionally dies or stops broadcasting, particularly if the device has not been rebooted in several days. It can be restarted with the PowerShell command (e.g. in a remote interactive session):
Start-Process ebootpinger.exe

Perl Scripts fails to connect to Netconf server when using Net::Netconf::Manager

I am using a perl script to log onto a remote router running JUNOS and get few information through the NETCONF port.
I am using the following library in order to do this
Net::Netconf::Manager
Net::Netconf::Device
Net::Netconf::Access
The script runs on the routers present on the same network but is failing to log into the routers that are on different networks, where as i am able to log onto the routers manually through Netconf over ssh.
The arguments I am parsing looks fine. Could any one help me resolve why this is happening.
If I need to do any checks in configuration (configuration looks fine to me) prior to running the script.