Just taking a moment to geek out. I finished my arduino code for my home HVAC project and decided to give it a burn in test tonight. I have 5 DS18S20 temperature sensors connected via parasitic 1-wire to pin 10 on a boarduino. My code just goes out and does a beacon looking for any 1-wire devices on the network and then queries them. It takes that data, turns it from hex to a Fahrenheit temperature and then prints a colon delimited string with that information out onto the serial port. I had been using just 1 probe, so tonight I decided for giggles to hot add 4 more. I smacked the ICs onto the breadboard while everything was running and what do you know, the code picked the new units up and never skipped a beat! Cool!
I enabled ssh on my ESXi server to help me troubleshoot what appears to be a hardware problem. Hardware problems can be a real pain to troubleshoot and since this one involved the USB storage that was encapsulating my ESXi install, sometimes rebooting when it was broken didn’t really work. It would just hang and I would have to power cycle the server. Turns out that was an issue with ESXi trying to be responsible and syncing the filesystems before it goes into reboot and, when the Hypervisor1 and Hypervisor2 fileystems aren’t available, this turns into a dead lock. Not to fear! simply ssh into the server and, without using tab completion, type this entire command into the console and hit enter.
reboot -f -n
That tells ESXi to reboot without doing a sync/flush to disk and without going through init. Essentially pulling the power cord. It’s drastic and it can cause no shortage of issues on your VMs filesystems, but when you are remote and can’t reach the cord this is a good option to have!
syslog-ng is a replacement for syslog and about 15 dozen little scripts that we’ve all written over the years to make syslog work the way we want. One of the most sought after features is the ability to create per host log files on a central syslog-ng server. With standard syslog it was possible to send logs from other machines over the network to a central collector, but they all arrived into a single file. You either had to parse that file with a script later on to get the host that you wanted or you had to run a usually intensive search and sort process to break out the data into individual logs. syslog-ng has native support for dumping individual remote syslog streams into their own file real time. I wont go into the hows and whys of the syslog-ng.conf file, it’s pretty complex, but if you paste the following code snippit into your conf file and restart syslog, you will get a new log file created in /var/log/HOSTS/ with the hostname or IP (depending on your global config) for each host that sends syslog data to your collector.
source s_udp { udp(); };
destination d_udp { file(“/var/log/HOSTS/$HOST”); };
log { source(s_udp); destination(d_udp); };
Note that this is assuming standard syslog clients dumping to this server over good old udp. If you have syslog-ng hosts dumping to this server, you can configure them to use tcp instead, but I leave that to you.
Using nomachine via SSH over port 443 to connect to my linux box at home that’s running windows XP inside of a virtual machine that uses Virtual Infrastructure client to connect to my ESXi server that has an XP VM that can telnet to my PDU in the rack in the basement.
In an effort to streamline the install of ESXi, vmware removed the management console that was used by so many advanced administrators to get day to day work done. This wouldn’t be a problem if adequate substitutes had been provided, but the Virtual Infrastructure Client and remote command line just don’t cut it. Here is how you can re-enable ssh on an ESXi server and work around not having SCP.
First, enable ssh by going to your physical ESXi console, logging in and hitting Alt + F1.
When you Alt + hit F1, you will see a screen that doesn’t have any way for you to interact with it. type the word “unsupported” into that screen and press enter. You will now be prompted to enter your password and you’ll get a big message about this being an unsupported operating mode for ESXi. Ignore that.
Now you need to edit the /etc/inetd.conf file using vi. Find the line that starts with
#ssh
and remove the #.
reboot your server and ssh should be working (you could alternatively kill -HUP inetd, but rebooting works too).
Unfortunatly, while this gives us ssh access, it doesn’t give us scp (or sftp which is just a gui frontend to scp). But no worries, scp is just a GUI around STDIN and STDOUT redirect in ssh. Lets say we wanted to scp a file called test.txt over to our ESXi machine. Using ssh from my linux box (might work in ssh for windows, haven’t tried that) I run the following command
cat test.txt | ssh root@esx “cat >test.txt”
And test.txt is transferred to my ESXi box using ssh! I’ve already dumped several ISO and VMDK files straight into the SATA based VMFS stores on my ESXi server.