Network Device Status Monitor v1.1

With this utility I set out to generate a status report of network attached devices from a CSV file. This utility is similar to my Windows Server Status Monitor PowerShell Utility, except the focus is on whether or not the network devices respond to a ping.

This utility is available to download from the Microsoft TechNet GalleryPowerShell Gallery and GitHub.

-Mike

 

Features and Requirements

  • The utility will display the network device name and IP address as specified in the CSV file.
  • The utility will display Online/Offline status of the specified devices.
  • The utility will display the response time of the network device.
  • The utility can display the results as either a CSV file or a HTML file.
  • The utility can be configured to monitor continuously, or run once.
  • The utility can be configured to e-mail the results.

The script has been tested running on Windows 10 and Windows Server 2016, monitoring network devices with IP v4 addresses.

 

CSV File Structure

The structure of the CSV file is as follows:

IP,Name
10.30.1.1,Router
10.30.1.5,NAS
10.30.1.10,Switch 1

 

Generating A Password File

The password used for SMTP server authentication must be in an encrypted text file. To generate the password file, run the following command in PowerShell, on the computer that is going to run the script and logged in with the user that will be running the script. When you run the command you will be prompted for a username and password. Enter the username and password you want to use to authenticate to your SMTP server.

Please note: This is only required if you need to authenticate to the SMTP server when send the log via e-mail.

$creds = Get-Credential
$creds.Password | ConvertFrom-SecureString | Set-Content c:\scripts\ps-script-pwd.txt

After running the commands, you will have a text file containing the encrypted password. When configuring the -Pwd switch enter the path and file name of this file.

 

Configuration

The table below shows all the command line options available with descriptions and example configurations.

Command Line Switch Mandatory Description Example
-List Yes The CSV file with the network devices you wish to test. C:\foo\NetworkDevices.csv
-O Yes The location to output the HTML or CSV results file. C:\foo
-Refresh No The number of seconds the script should wait before refreshing the results.

The minimum refresh period is 300 seconds (5 minutes) and the maximum is 28800 (8 hours).

600
-Light No Configure the HTML results file to have a light theme. N/A
-Csv No Export a CSV file, instead of a HTML file. N/A
-SendTo No The email address to send the log file to. me@contoso.com
-From No* The email address that the log file should be sent from.

*This switch isn’t mandatory but is required if you wish to email the log file.

example@contoso.com
-Smtp No* SMTP server address to use for the email functionality.

*This switch isn’t mandatory but is required if you wish to email the log file.

mail01.contoso.com

OR

smtp.live.com

OR

smtp.office365.com

-User No* The username of the account to use for SMTP authentication.

*This switch isn’t mandatory but may be required depending on the configuration of the SMTP server.

example@contoso.com
-Pwd No* The location of the file containing the encrypted password of the account to use for SMTP authentication.

*This switch isn’t mandatory but may be required depending on your SMTP server.

c:\foo\ps-script-pwd.txt
-UseSsl No* Add this option if you wish to use SSL with the configured SMTP server.

Tip: If you wish to send email to outlook.com or office365.com you will need this.

*This switch isn’t mandatory but may be required depending on the configuration of the SMTP server.

N/A

 

Change Log

2019-02-23 Version 1.1

  • Updated the style of the web page with a cleaner look.
  • Added ‘online’ CSS animation when the web page is in monitor mode – this is configured by using the refresh switch. It will not display when in report mode (no refresh switch).

2018-06-13 Version 1.0

  • First public release.
  • Based off Windows Server Status Monitor version 1.5 code.

 

PowerShell Code

Normally I’d put the powershell code here, but due to the amount of HTML in this one it doesn’t play well with the blog.

You can see the code and obtain the script from the links at the top of this post.

One Comment Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.