[munin/innd_*] Import initial de innd_last, corrections
darcs-hash:20090330124424-ddb99-69b33343e6ce18eda8a89e027b74f3b8a0a984f2.gz
This commit is contained in:
parent
de47e037de
commit
3e938bbac8
2 changed files with 37 additions and 4 deletions
|
@ -20,8 +20,7 @@
|
|||
"""Plugin munin pour innd."""
|
||||
|
||||
## Importations
|
||||
import socket
|
||||
import sys
|
||||
import socket, sys, time
|
||||
|
||||
def recvlines(sock):
|
||||
buff = sock.recv(4096)
|
||||
|
@ -35,6 +34,10 @@ s.connect(('localhost', 119))
|
|||
|
||||
## Mise en mode reader (pour utiliser 'listgroup')
|
||||
s.send("mode reader\r\n")
|
||||
|
||||
# Petit "hack" en attendant d'utiliser la nntplib
|
||||
time.sleep(0.5)
|
||||
|
||||
s.recv(4096)
|
||||
|
||||
## Récupération des newsgroups et du nombre de posts
|
||||
|
@ -63,9 +66,9 @@ for l in recvlines(s)[1:]:
|
|||
if len(sys.argv) > 1 and sys.argv[1] == 'config':
|
||||
# Configuration du graphe
|
||||
print 'host_name news.crans.org'
|
||||
print 'graph_title Nombre de posts'
|
||||
print 'graph_title Nombre total de posts'
|
||||
print 'graph_args --base 1000 --lower-limit 0'
|
||||
print 'graph_vlabel nombre de posts'
|
||||
print 'graph_vlabel posts'
|
||||
print 'graph_category News'
|
||||
print 'graph_description Nombre de posts pour chaque newsgroup'
|
||||
(ng0, cng0, val0) = newsgroups[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue