#!/bin/sh
# -*- sh -*-

: << =cut

=head1 NAME

id - Plugin for testing user and group statements in the plugin config.

=head1 NOTES

This plugin is used for munin testing and development.

=head1 AUTHOR

Copyright (C) 2006 Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org>

=head1 LICENSE

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.

=head1 MAGIC MARKERS

 #%# family=test

=cut

if [ "$1" = "config" ]; then
    echo "graph_title User and groups"
    echo "graph no"
    echo "uid.label User ID"
    echo "gid.label Group ID"
    exit 0
fi

echo -n "uid.value "
id -u
echo -n "uid.extinfo "
id -nu
echo -n "gid.value "
id -g
echo -n "gid.extinfo "
id -Gn
