Table of Contents

Name

nagios-check-longuserprocesses - shows minutes and pid of longest running user process

Synopsis

nagios-check-longuserprocesses MIN-UID [EXCLUDE-PROCESSNAME1 [EXCLUDE-PROCESSNAME2]] [...]

Description

This program searches for the longest running process with the given minimum UID and prints the time running in minutes and the process ID. Processnames to be skipped may be specified as optional arguments. If no process with given attributes is running just two lines with "0" are printed. The process attributes are read from /proc/*/status and /proc/*/stat.
The primary purpose is the usage as nagios remote plugin with net-snmp. Just add to snmpd.conf a single line like this:
extend .1.3.6.1.4.1.2021.99 cron /usr/local/sbin/nagios-check-longuserprocesses 630 vsftpd bash

Return Value

The return value is 1 on any open or read error. On success 0 is returned.

Examples

nagios-check-longuserprocesses 630 vsftpd

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents