mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
239 stars 94 forks source link

Failed to add counter: PdhCollectQueryData failed: : 800007d5: Aucune donnée à renvoyer. #648

Open o2-technique opened 4 years ago

o2-technique commented 4 years ago

Greeting,

I have recently installed nsclient software on my computer. My goal is to monitore the state of its hard disk from Nagios.

In my nsclient.ini file, I have the following configurations :

################################### alias_counter_disk_AvgWQL = CheckCounter "Counter:Disk_avg_write_queue=\Disque physique(_Total)\Longueur moyenne de file d\'attente écriture disque" MaxWarn=5 MaxCrit=10 alias_counter_disk_AvgRQL = CheckCounter "Counter:Disk_avg_read_queue=\Disque physique(_Total)\Longueur moyenne de file d\'attente lecture disque" MaxWarn=5 MaxCrit=10 ##################################

When I take a look at nagios , the following informations have been found with an unknown state and I wonder if you could explain to me what is happen please.

################################## Disk Avg Read Queue : Failed to add counter: PdhCollectQueryData failed: : 800007d5: Aucune donnée à renvoyer. Disk Avg Write Queue: Failed to add counter: PdhCollectQueryData failed: : 800007d5: Aucune donnée à renvoyer. ##################################

image

I'd just like to emphasize that when I launch the following command with powershell, I can have a result as seen in the following picture.

Command :

Get-Counter -Counter '\Disque physique(_Total)\Longueur moyenne de file d''attente écriture disque'

Result :

image

Please, what should I do ? Thanks in advance

avezinaATastus commented 4 years ago

Hi o2,

I might not help much, but have you looked to the section in the docs about localized counters? This might help you.

You need to query the counter by it's index instead of its name.

check_pdh "counter=\\4\\30" "warn=value > 5" "crit=value > 9999" expand-index
Everything looks good
'\Minne\Dedikationsgräns value'=-2147483648;5;9999

On my side, I decided to use predefined counters, because it is easier on the config side ( I set an INI file via GPO that contains needed config )

Perf Counters check_pdh

Je te souhaite bonne chance. La documentation n'est pas complète, mais joue avec nscp.exe test et le listing des compteurs. Ça m'a bien aidé.

o2-technique commented 4 years ago

Hello avezinaATastus,

Thank you for your response. I've tried to use check_pdh. As a result, I had an informations from my computer but I could not get informations about my hard disk which are about "Longueur moyenne de file d'attente lecture disque" and "Longueur moyenne de file d'attente écriture disque" to be precise. As said in my comment above, I can get results via powershell, I mean by launching command. So as a kind of solutions, I've created a script shell which launchs this command and uploads results from the client to the nagios server.

Thank you

thomass4t commented 1 year ago

Hello, I have the same issue. The counter works on 2 other disks on the system but one of the disk randomly fails to read the perf counter: Failed to add counter: PdhCollectQueryData failed: : 800007d5: Keine Daten. (Keine Date = no data)

The disks are all RAID-disks consisting of 2 underlying physical disks. I also tried the reload parameter but it keeps flapping. Using PowerShell I can always query the counter. My ini looks like: alias_warteschlange_1=check_pdh "counter=\Physikalischer Datenträger(1 E:)\Durchschnittl. Warteschlangenlänge des Datenträgers" "warn=value>=1" "crit=value>=3" alias_warteschlange_2=check_pdh "counter=\Physikalischer Datenträger(2 D:)\Durchschnittl. Warteschlangenlänge des Datenträgers" "warn=value>=1" "crit=value>=3" alias_warteschlange_3=check_pdh "counter=\Physikalischer Datenträger(3 E:)\Durchschnittl. Warteschlangenlänge des Datenträgers" "warn=value>=1" "crit=value>=3" alias_warteschlange_4=check_pdh "counter=\Physikalischer Datenträger(4 C: F:)\Durchschnittl. Warteschlangenlänge des Datenträgers" "warn=value>=1" "crit=value>=3" reload debug type=double

Only the last one is flapping constantly, every day. All the other checks work. "reload, debug and type" was added but didn't help. I updated to the latest pre-release 0.5.3.4 but it's still flapping. Any suggestions how to dig deeper?