GroupStudy.com GroupStudy.com - A virtual community of network engineers
 Home  BookStore  StudyNotes  Links  Archives  StudyRooms  HelpWanted  Discounts  Login
Re: OT: scripts or application to generate sample [7:108032] posted 03/23/2006
[Chronological Index] [Thread Index] [Top] [Date Prev][Date Next] [Thread Prev][Thread Next]


--8w3uRX/HFJGApMzv
Content-Type: multipart/mixed; boundary="ctP54qlpMx3WjD+/"
Content-Disposition: inline


--ctP54qlpMx3WjD+/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

An entity claiming to be ccie4u (sales@xxxxxxxxxx) wrote:
:=20
: Have some log aggregation devices I am looking at and would like to test
: them out by sending a lot of syslog or other type of log data to it. The
: testbed doesn't have much traffic or logs that are generated so looking f=
or
: any thoughts or input on ways to generate a lot of logs (from real devices
: such as switches and routers in the testbed or virtual logs via an app or
: script).
:=20

Here's one I slapped together, it uses Perl (5.6.1 or better) and the

http://search.cpan.org/CPAN/authors/id/A/AD/ADEOLA/Text-Lorem-0.3.tar.gz

The script syntax is: gensyslog   [  ]

The "min" parameter is the minimum delay (in seconds) between messages.  If=
=20
a "max" value is specified, a random delay is chosen between min and max.
Note that real values may be used.  The script sends syslog messages with=
=20
randomly selected facilities and log levels.  The text of the syslog
messages is pseudo-Latin.

Mark

--=20
[]                       |
[] Mark Rogaski          |     The Creation of the Universe was made
[] wendigo@xxxxxxxxx     |     possible by a grant from Texas Instruments.
[] mrogaski@xxxxxxxx     |                               -- PBS
[]                       |

--ctP54qlpMx3WjD+/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=gensyslog
Content-Transfer-Encoding: quoted-printable

#!/usr/local/bin/perl
#
# $Id: gensyslog,v 1.1.1.1 2006/03/23 07:23:01 wendigo Exp $
#
# gensyslog - send random syslog messages to a network host
#
# Author: Mark Rogaski 
#
# Copyright (c) 2006 Mark Rogaski.  All rights reserved.
#
# This program is free software; you can redistribute=20
# it and/or modify it under the same terms as Perl itself.
#
# Usage: gensyslog   [  ]
#
use 5.6.1;
use strict;
no strict 'subs';
use warnings;

use Sys::Syslog qw( :standard setlogsock );
use Text::Lorem;

our @Facility =3D (
    LOG_AUTH,
    LOG_AUTHPRIV,
    LOG_CRON,
    LOG_DAEMON,
    LOG_FTP,
    LOG_KERN,
    LOG_LOCAL0,
    LOG_LOCAL1,
    LOG_LOCAL2,
    LOG_LOCAL3,
    LOG_LOCAL4,
    LOG_LOCAL5,
    LOG_LOCAL6,
    LOG_LOCAL7,
    LOG_LPR,
    LOG_MAIL,
    LOG_NEWS,
    LOG_USER,
    LOG_UUCP,
);

our @Level =3D (
    LOG_ALERT,
    LOG_CRIT,
    LOG_ERR,
    LOG_WARNING,
    LOG_NOTICE,
    LOG_INFO,
    LOG_DEBUG,
);

our $text =3D Text::Lorem->new;
our($host, $min, $max) =3D @ARGV;

if (@ARGV sentences(1);

    select(undef, undef, undef, $delay);

    printf "sending %s (%s/%s) %sn", $host, $fac, $lvl, $str;

    openlog 'gensyslog', 'ndelay', $fac;
    syslog $lvl, $str;
    closelog;

}

__END__


--ctP54qlpMx3WjD+/--

--8w3uRX/HFJGApMzv
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEIlAAe3p4SwVZZdwRAtlRAJ9PntAqNMg7tQGOB2CO9P5TTLtVTwCdF0+3
rzlVRljyx+y/27LrMSOSd/E=
=AD0g
-----END PGP SIGNATURE-----

--8w3uRX/HFJGApMzv--




Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=108038&t=108032
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html