Skip to content

Commit 3e28cb3

Browse files
Robin BowesBrice Figureau
Robin Bowes
authored and
Brice Figureau
committed
Rename mysql-agent to mysql-snmp
1 parent 97eda90 commit 3e28cb3

10 files changed

+42
-41
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
build:
1515

1616
install:
17-
install -m 755 mysql-agent $(DESTDIR)/usr/sbin/mysql-agent
17+
install -m 755 mysql-snmp $(DESTDIR)/usr/sbin/mysql-snmp
1818
install -m 644 MYSQL-SERVER-MIB.txt $(DESTDIR)/usr/share/snmp/mibs
19-
install -m 644 mysql-agent.1 $(DESTDIR)/usr/share/man/man1
20-
gzip $(DESTDIR)/usr/share/man/man1/mysql-agent.1
19+
install -m 644 mysql-snmp.1 $(DESTDIR)/usr/share/man/man1
20+
gzip $(DESTDIR)/usr/share/man/man1/mysql-snmp.1
2121

2222
clean:
23-
-rm $(DESTDIR)/usr/sbin/mysql-agent
23+
-rm $(DESTDIR)/usr/sbin/mysql-snmp
2424

README

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (c) 2008,2009 Brice Figureau <[email protected]>
44
PREAMBLE
55
========
66

7-
mysql-agent is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp
7+
mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp
88
Perl bindings.
99

1010
It connects to a mysql server and returns information to Net-SNMP when needed.
@@ -43,7 +43,7 @@ Please build the package:
4343
$ dpkg-buildpackage -rfakeroot -uc- b
4444

4545
and install it
46-
Then, modify /etc/default/mysql-agent
46+
Then, modify /etc/default/mysql-snmp
4747

4848
Other
4949
-----

debian/init.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
### END INIT INFO
2626

2727
PATH=/sbin:/bin:/usr/sbin:/usr/bin
28-
DAEMON=/usr/sbin/mysql-agent
28+
DAEMON=/usr/sbin/mysql-smnp
2929
DAEMON2="/usr/bin/perl"
30-
NAME=mysql-agent
30+
NAME=mysql-snmp
3131
DESC="Mysql SNMP Agent"
32-
PID_FILE=/var/run/mysql-agent.pid
32+
PID_FILE=/var/run/mysql-snmp.pid
3333

3434
test -x $DAEMON || exit 0
3535

mysql-agent mysql-snmp

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
use strict;
2525

26-
my $VERSION = "v1.0_02";
26+
my $VERSION = "v1.1_01";
2727
$VERSION = eval $VERSION;
2828

2929
## Packages ##
@@ -405,7 +405,7 @@ use DBD::mysql;
405405
use Pod::Usage;
406406

407407
my %opt = (
408-
daemon_pid => '/var/run/mysql-agent.pid',
408+
daemon_pid => '/var/run/mysql-snmp.pid',
409409
oid => '1.3.6.1.4.1.20267.200.1',
410410
port => 3306,
411411
refresh => 300,
@@ -622,9 +622,9 @@ run() unless caller();
622622

623623
# daemonize the program
624624
sub daemonize {
625-
open STDIN, '/dev/null' or die "mysql-agent: can't read /dev/null: $!";
626-
open STDOUT, '>/dev/null' or die "mysql-agent: can't write to /dev/null: $!";
627-
defined(my $pid = fork) or die "mysql-agent: can't fork: $!";
625+
open STDIN, '/dev/null' or die "mysql-snmp: can't read /dev/null: $!";
626+
open STDOUT, '>/dev/null' or die "mysql-snmp: can't write to /dev/null: $!";
627+
defined(my $pid = fork) or die "mysql-snmp: can't fork: $!";
628628
if ($pid) {
629629
# parent
630630
open my $pidfile, '>', $opt{daemon_pid}
@@ -635,8 +635,8 @@ sub daemonize {
635635
}
636636

637637
# child
638-
setsid() or die "mysql-agent: can't start a new session: $!";
639-
open STDERR, '>&STDOUT' or die "mysql-agent: can't dup stdout: $!";
638+
setsid() or die "mysql-snmp: can't start a new session: $!";
639+
open STDERR, '>&STDOUT' or die "mysql-snmp: can't dup stdout: $!";
640640
}
641641

642642
sub max {
@@ -988,7 +988,7 @@ sub dolog {
988988
}
989989

990990
sub VersionMessage {
991-
print "mysql-agent $VERSION by brice.figureau\@daysofwonder.com\n";
991+
print "mysql-snmp $VERSION by brice.figureau\@daysofwonder.com\n";
992992
}
993993

994994
sub run
@@ -1031,7 +1031,7 @@ sub run
10311031
$dsn .= join(';', "host=$opt{host}", "port=$opt{port}");
10321032
}
10331033

1034-
openlog("mysql-agent", LOG_PID | LOG_PERROR, LOG_DAEMON);
1034+
openlog("mysql-snmp", LOG_PID | LOG_PERROR, LOG_DAEMON);
10351035

10361036
daemonize() if !$opt{'no-daemon'};
10371037

@@ -1080,11 +1080,11 @@ __END__
10801080
10811081
=head1 NAME
10821082
1083-
mysql-agent - report mysql statistics via SNMP
1083+
mysql-snmp - report mysql statistics via SNMP
10841084
10851085
=head1 SYNOPSIS
10861086
1087-
mysql-agent [options]
1087+
mysql-snmp [options]
10881088
10891089
-h HOST, --host=HOST connect to MySQL DB on HOST
10901090
-P PORT, --port=PORT port to connect (default 3306)
@@ -1199,7 +1199,7 @@ output version information and exit
11991199
12001200
=head1 DESCRIPTION
12011201
1202-
B<mysql-agent> is a small daemon that connects to a local snmpd daemon
1202+
B<mysql-snmp> is a small daemon that connects to a local snmpd daemon
12031203
to report statistics on a local or remote MySQL server.
12041204
12051205
=cut

mysql-agent.1 mysql-snmp.1

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
.\" .sp <n> insert n+1 empty lines
1717
.\" for manpage-specific macros, see man(7)
1818
.SH NAME
19-
mysql-agent \- MySQL-Server SNMP agent for Net-SNMP
19+
mysql-snmp \- MySQL-Server SNMP agent for Net-SNMP
2020
.SH SYNOPSIS
21-
.B mysql-agent
21+
.B mysql-snmp
2222
.RI "[ options ]"
2323
.SH DESCRIPTION
24-
.B mysql-agent
24+
.B mysql-snmp
2525
is a Net-SNMP (snmpd) agent that can be used to monitor a MySQL server with SNMP.
2626
.PP
2727
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
@@ -44,7 +44,7 @@ output version information and exit
4444

4545
.TP
4646
.B \-\-daemon-pid=FILE
47-
write PID to FILE instead of /var/run/mysql-agent.pid
47+
write PID to FILE instead of /var/run/mysql-snmp.pid
4848

4949
.TP
5050
.B \-u DBUSER
@@ -105,7 +105,7 @@ password=secret
105105
.BR snmpcmd (1).
106106
.br
107107
.SH AUTHOR
108-
mysql-agent was written by Brice Figureau
108+
mysql-snmp was written by Brice Figureau
109109
.PP
110110
This manual page was written by Brice Figureau <[email protected]>,
111111
for the Debian project (but may be used by others).

opennms/tools/cacti2opennms.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ =head1 OPTIONS
393393
* graph: outputs the content of the snmp-graph.properties
394394
* graphlist: outputs the content of the snmp-graph.properties reports key
395395
* datacollection: outputs the content of the datacollections-config.xml file
396-
* agent: outputs the needed array for mysql-agent
396+
* agent: outputs the needed array for mysql-snmp
397397
398398
=item B<--man>
399399
@@ -415,7 +415,7 @@ =head1 OPTIONS
415415
416416
=head1 DESCRIPTION
417417
418-
B<mysql-agent> is a small daemon that connects to a local snmpd daemon
418+
B<mysql-snmp> is a small daemon that connects to a local snmpd daemon
419419
to report statistics on a local or remote MySQL server.
420420
421421
=cut

redhat/mysql-agent.init redhat/mysql-snmp.init

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#! /bin/sh
22
#
3-
# mysql-agent Init script for running the mysql snmp agent daemon
3+
# mysql-snmp Init script for running the mysql snmp agent daemon
44
#
55
# Author: Robin Bowes <[email protected]>
66
#
77
# chkconfig: - 98 02
88
#
99
# description: Enables monitoring of MySQL through SNMP
10-
# processname: mysql-agent
11-
# config: /etc/sysconfig/mysql-agent
10+
# processname: mysql-snmp
11+
# config: /etc/sysconfig/mysql-snmp
1212
#
1313
# This script is based on a debian init script written by Brice Figureau
1414
#
@@ -19,10 +19,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
1919
# Source function library.
2020
. /etc/rc.d/init.d/functions
2121

22-
prog=mysql-agent
22+
prog=mysql-snmp
2323
daemon="/usr/sbin/$prog"
2424

25-
# Include mysql-agent defaults if available
25+
# Include mysql-snmp defaults if available
2626
if [ -e /etc/sysconfig/$prog ] ; then
2727
. /etc/sysconfig/$prog
2828
fi

redhat/mysql-agent.spec redhat/mysql-snmp.spec

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Name: mysql-agent
2-
Version: 1.0
1+
Name: mysql-snmp
2+
Version: 1.1
33
Release: 1%{?dist}
44
Summary: SNMP monitoring agent for MySQL
55

@@ -14,6 +14,7 @@ Requires: perl(DBI), perl(DBD::mysql) >= 1.0, perl(Unix::Syslog)
1414
Requires: perl(SNMP), perl(NetSNMP::OID), perl(NetSNMP::agent), perl(NetSNMP::ASN)
1515
Requires: perl(NetSNMP::agent::default_store), perl(NetSNMP::default_store)
1616
Requires: net-snmp >= 5.4.2
17+
Obsoletes: mysql-agent
1718

1819
%description
1920
mysql-snmp is a small daemon that connects to a local snmpd daemon
@@ -30,12 +31,12 @@ install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
3031
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
3132
install -d ${RPM_BUILD_ROOT}%{_mandir}/man1
3233
install -d ${RPM_BUILD_ROOT}%{_datadir}/snmp/mibs
33-
install -c -m 755 mysql-agent ${RPM_BUILD_ROOT}%{_sbindir}
34-
install -c -m 755 redhat/mysql-agent.init ${RPM_BUILD_ROOT}%{_initrddir}/%{name}
35-
install -c -m 644 redhat/mysql-agent.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
34+
install -c -m 755 mysql-snmp ${RPM_BUILD_ROOT}%{_sbindir}
35+
install -c -m 755 redhat/mysql-snmp.init ${RPM_BUILD_ROOT}%{_initrddir}/%{name}
36+
install -c -m 644 redhat/mysql-snmp.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
3637
install -c -m 600 my.cnf ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
37-
install -c -m 644 mysql-agent.1 ${RPM_BUILD_ROOT}%{_mandir}/man1
38-
gzip ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-agent.1
38+
install -c -m 644 mysql-snmp.1 ${RPM_BUILD_ROOT}%{_mandir}/man1
39+
gzip ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-snmp.1
3940
install -m 644 MYSQL-SERVER-MIB.txt ${RPM_BUILD_ROOT}%{_datadir}/snmp/mibs
4041

4142
%clean
File renamed without changes.

tests/test.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl -w
22

33
BEGIN {
4-
require 'mysql-agent';
4+
require 'mysql-snmp';
55
}
66

77
use Test::More tests => 11;

0 commit comments

Comments
 (0)