Dashboard to monitor FTP downloads of orders from customers

#1

So I got tasked at work to automate the process of pulling files from an FTP site, removing the files once downloaded, then moving them to a specific folder on the network, so that they can be automatically imported into the database. I accomplished this using scheduled tasks for powershell to run at set time intervals. But how do you know everything is working? Simples design a beautiful dashboard


So this shows me the previous week of log files along the top and their file sizes (yes we had an issue on the 25/11/2018) shows how many orders have been imported into the network folder (hoping this will get me a bonus) shows how many orders have been done today, and the current size of the log file. It also shows me in real time when files come in to be processed. I also monitor the status of the service which is running on a separate server. This allows me to glance at this dashboard and see if there has been any issues downloading and importing.

6 Likes

#2

Fantastic work. Care to share any code? :slight_smile:

0 Likes

#3

Thanks glad you liked this…this dashboard is linked to powershell jobs that are downloading the files from the remote FTP site, then I am just showing the statistics. Is there a particular bit of the dashboard you wanted to see the code for? Always happy to help

0 Likes

#4

Is the data just reading information from files/folders or are you persisting data some other way?

0 Likes

#5

Yeah the data is just reading file/folders so each of the top cards are made up of the following code:-

$date6 = (Get-Date).AddDays(-6).ToString(‘yyyy-MM-dd’)
log6 = Write-Host "Log File ((get-date).AddDays(-6).ToShortDateString())"
$l6name = “UnattendedImport.$date6.log”
$path6 = “\YOUR-SERVER\logs$l6name”
if (Test-Path $path6) {$f6 = gci “path6" | Select Name,@{Name="Kilobytes";Expression={[math]::round(_.Length/1kb)}} }
else {$f6 = “Not Found”}
if (f6 -match "Not Found") {New-UDParagraph -Text "(f6)" -Color "#8b2635"} else {New-UDParagraph -Text "($f6.Kilobytes)KB” -Color “Green”}

Similar stuff is done to build up the stats of the cards/counters…the monitor shows real-time on FTP files being imported into the system it’s served my well this dashboard now up to 17,020 processed orders

0 Likes