From f38e6e9d75a6d668d1ceb8ec438071ca4ea52c24 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Sun, 6 Jan 2008 06:13:14 +0100 Subject: [PATCH] Ajout de laserjet__pages et uniformisation des noms darcs-hash:20080106051314-61eff-579c3d71c5ee1f51e81baf75e2ba12ea48195636.gz --- munin/{etat_imprimante => laserjet__etat} | 0 munin/laserjet__pages | 30 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) rename munin/{etat_imprimante => laserjet__etat} (100%) create mode 100755 munin/laserjet__pages diff --git a/munin/etat_imprimante b/munin/laserjet__etat similarity index 100% rename from munin/etat_imprimante rename to munin/laserjet__etat diff --git a/munin/laserjet__pages b/munin/laserjet__pages new file mode 100755 index 00000000..7a2021ce --- /dev/null +++ b/munin/laserjet__pages @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-15 -* + +import sys, os +sys.path.append("/usr/scripts/gestion") + +import hptools + + +if len(sys.argv) > 1: + arg = sys.argv[1] +else: + arg = '' + +if arg == "config": + # Ecrit sur la sortie standard la configuration + print 'host_name laserjet' + print "graph_category etat" + print "graph_title Pages imprimees" + print "graph_vlabel nb" + print "total.label Total" +else: + # Ecrit les valeurs actuelles sur la sortie standard + oid = "1.3.6.1.2.1.43.10.2.1.4.1.1" + try : + comm = hptools.snmp(host="laserjet.adm.crans.org", version="1", community="public") + print "total.value %s" % comm.get(oid) + except : + print "" +