Scanning Subnets for Hosts from Mac OS Terminal

If you don’t have an IP management tool, keeping track of free and used IPs can be a bit of a pain.  I’d highly recommend deploying an automated tool such as phpIPAM, but in a pinch Terminal can do the job.  When you get a reply from an IP address, it’s (obviously) in use.

For example, if you’re you have a subnet 192.168.5.0/24 here’s how the command would look.

for x in {2..254}; do ping -c 1 -W 100 192.168.5.$x | grep 'time='; done

And here it is in use:

bash-3.2# for x in {1..254}; do ping -c 1 -W 100 192.168.5.$x | grep 'time='; done
64 bytes from 192.168.5.2: icmp_seq=0 ttl=248 time=4.922 ms
64 bytes from 192.168.5.8: icmp_seq=0 ttl=56 time=6.822 ms
64 bytes from 192.168.5.30: icmp_seq=0 ttl=56 time=5.620 ms
64 bytes from 192.168.5.39: icmp_seq=0 ttl=120 time=8.269 ms
64 bytes from 192.168.5.41: icmp_seq=0 ttl=120 time=6.493 ms
64 bytes from 192.168.5.44: icmp_seq=0 ttl=120 time=4.684 ms
64 bytes from 192.168.5.46: icmp_seq=0 ttl=120 time=5.690 ms
64 bytes from 192.168.5.63: icmp_seq=0 ttl=120 time=5.916 ms
64 bytes from 192.168.5.102: icmp_seq=0 ttl=56 time=5.458 ms
bash-3.2#

Monitoring Temperature on HP 3800 Series Switches

I’ve been working with HP 3800 Series switches (J9574A specifically) for some time now and recently we’ve migrated from monitoring them with HPE IMC to PRTG by Paessler.  The one thing that I’ve never been able to monitor, even after a few scares with HVAC units going out, was the switch temperature.  We had some basic monitoring on our closets, but that would only alert building management or the facilities team who would then reach out to us.  To be more proactive I knew I had to find a way to monitor and alert on temperature directly from the switch.  

I knew it was possible since I could gather temperature information from a few commands:

show system temperature
walkMIB hpchassistemperature
getmIB hpSystemAirCurrentTemp.0

So, after lots of digging I found the OID that corresponds to hpSystemAirCurrentTemp.0, 1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.3.0.

Now with the proper monitoring and alerting tools, you can get a readout in degrees Celsius versus Unknown, Bad, Warning, Good, or NotPresent.  This will only provide the readout for one switch, even when in a stack. However, that should be good enough to know a basic temperature of your IDF / MDF closet and whether or not you need to jump on the phone with someone.

2 Day Graph