source: noc/ng/cgi-bin/testentry.pl @ 991

Last change on this file since 991 was 42, checked in by presbrey, 18 years ago
scripts.mit.edu NOC graphing
File size: 973 bytes
Line 
1#!/usr/bin/perl
2
3# File:    $Id: testentry.pl,v 1.4 2005/10/08 05:55:08 sauber Exp $
4# Author:  (c) Soren Dossing, 2005
5# License: OSI Artistic License
6#          http://www.opensource.org/licenses/artistic-license.php
7
8# Modify this script to test map entries before inserting into real
9# map file. Run the script and check if the output is as expected.
10
11use strict;
12no strict "subs";
13use Data::Dumper;
14my @s;
15
16# Insert servicesdescr, output and perfdata here as it appears in log file.
17#
18$_ = <<DATA;
19servicedescr:ping
20output:Total RX Bytes: 4058.14 MB, Total TX Bytes: 2697.28 MB<br>Average Traffic: 3.57 kB/s (0.0%) in, 4.92 kB/s (0.0%) out| inUsage=0.0,85,98 outUsage=0.0,85,98
21perfdata:
22DATA
23
24eval {
25
26# Insert here a map entry to parse the nagios plugin data above.
27#
28/output:.*Average Traffic.*?([.\d]+) kB.+?([.\d]+) kB/
29and push @s, [ rxbytes,
30               [ in,  GAUGE, $1 ],
31               [ out, GAUGE, $2 ] ];
32
33};
34
35print Data::Dumper->Dump([\@s], [qw(*s)]);
Note: See TracBrowser for help on using the repository browser.