How do I make a graph out of my powershell check?


#1

Hi all,

I have a one line powershell script (wheeeee!) that checks how many print jobs are on a spooler on a print server. it returns a value to Icinga and it displays 100% OK. I have perf data on. How do I tell Icinga to make a graph out of it? I had a quick look at nagios docs and it says to do this:

This is the expected format:

'label'=value[UOM];[warn];[crit];[min];[max]

Would appreciate any help!

thanks


#2

Your plugin should output the data as described:
OK - All printers running | 'running'=10;1;3
assuming that the plugin will turn to WARNING when at least one two printers are not running, and CRITICAL when three four or more are not running.


(Roland) #3

According to Nagios Plugins Development Guidelines it would be CRITICAL if value is over 3 and WARNING if value is over 1?


#4

Yes, you’re correct and I changed my previous answer to reflect the documentation. Specifiying thresholds for things like volume checking I didn’t verify if the notification was sent when the current value is at or above the warning/critical threshold value :slightly_frowning_face:.


#5

Thanks a lot all. Will check those this afternoon.

I am not really looking for thresholds. I just want to see trends on a graph, ie checks every 5 mins and sees how many jobs are on the print spooler - example: now 300, in 5 mins 310, in 10 mins, 305, in 15 mine 309 etc and that that is represented on a graph, such as the graphs I have for cpu/mem using stock Icinga services.


#6

No problem, a bit shorter:


#7

Cheers Wolfgang! All good now. :+1: