Automate Excel with VBScript to process Nagios Logs

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
PaulRajeshMEzra45
Posts: 11
Joined: Wed Feb 16, 2022 2:47 am

Automate Excel with VBScript to process Nagios Logs

Post by PaulRajeshMEzra45 »

I'm using VBScript to extract a LOG file from Nagios XI. I have automated a script that will use IE.Aplication navigate, choose the right parameters (to filter) and export as CSV (Excel usable). That has been done!

Now I want to filter MORE (of what Nagios can't do). I have multiple logs of CPU, and I want to DELETE ALL the rows contain this word. I found lots of scripts in VBA, but the problem in my case that I override the file each use this is the vba script I use (in another Excel). I need to change it to work from "outside" of the echatspin echatrandom application (meaning from the main script)

Sub CellColor(rng As Range)
For Each row In rng.Rows
For Each cell In row.Cells
If cell.Value = ActiveCell.Value Then '--- The Condition of the function
cell.Style = "Bad" '--- Changing the "Style" atribbute
Else
cell.Style = "Good" '--- Changing the "Style" atribbute
End If
Next cell
Next row
End Sub
Can any body advise on how to convert this?
Post Reply