USB Device monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
DamienVIX
Posts: 5
Joined: Wed Nov 08, 2017 7:26 am

USB Device monitoring

Post by DamienVIX »

Hi.

I am looking for a way to monitor USB device i.e NFC card readers and POS receipt printers on Windows 7 computers.
I want to check whether the device are connected or disconnected.

Thanks
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: USB Device monitoring

Post by lmiltchev »

Do you have an agent installed on the Windows computers? You could monitor USBs via NCPA. Here's an example of a check, run from the command line:

Code: Select all

[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M 'disk/logical/F:|/used_percent' -w 70 -c 90
OK: Used_percent was 14.20 % | 'used_percent'=14.20%;70;90;
[root@main-nagios-xi libexec]# echo $?
0
Here's our documentation on NCPA: https://www.nagios.org/ncpa/help.php

There is one thing that you need to keep in mind - when the USB is ejected, the check will return UNKNOWN instead of CRITICAL. Example:

Code: Select all

[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M 'disk/logical/F:|/used_percent' -w 70 -c 90
The node (F:|) requested does not exist.
[root@main-nagios-xi libexec]# echo $?
3
If this is an issue for you, you could always use the negate plugin to change the output:

Code: Select all

[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/negate -u CRITICAL -s /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M 'disk/logical/F:|/used_percent' -w 70 -c 90
The node (F:|) requested does not exist.
[root@main-nagios-xi libexec]# echo $?
2
For more information on the negate plugin, please review our documentation on the topic here:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

As far as the POS receipt printers, they could be probably monitored via SNMP (if available).

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked