automatic version update by autodist [release 5.7.2-1mamba;Sun Oct 21 2012]
This commit is contained in:
parent
9698106664
commit
bcd85a2226
@ -1,2 +1,10 @@
|
||||
# net-snmp
|
||||
|
||||
Net-snmp includes various tools relating to the Simple Network Management Protocol:
|
||||
* An extensible agent
|
||||
* An SNMP library
|
||||
* tools to request or set information from SNMP agents
|
||||
* tools to generate and handle SNMP traps
|
||||
* a version of the unix 'netstat' command using SNMP
|
||||
* a graphical Perl/Tk/SNMP based mib browser
|
||||
|
||||
|
452
net-snmp.spec
Normal file
452
net-snmp.spec
Normal file
@ -0,0 +1,452 @@
|
||||
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
|
||||
|
||||
Name: net-snmp
|
||||
Version: 5.7.2
|
||||
Release: 1mamba
|
||||
Summary: net-snmp is an extensible SNMP agent and library and more
|
||||
Group: Network/Monitoring
|
||||
Vendor: openmamba
|
||||
Distribution: openmamba
|
||||
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
URL: http://net-snmp.sourceforge.net/
|
||||
Source0: http://downloads.sourceforge.net/sourceforge/net-snmp/net-snmp-%{version}.tar.gz
|
||||
Source1: net-snmpd.initscript
|
||||
Source2: net-snmptrapd.initscript
|
||||
Source3: net-snmpd.logrotate
|
||||
Source4: net-snmptrapd.logrotate
|
||||
License: BSD
|
||||
## AUTOBUILDREQ-BEGIN
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: libnl-devel
|
||||
BuildRequires: libopenssl-devel
|
||||
BuildRequires: libpython-devel
|
||||
BuildRequires: libwrap-devel
|
||||
BuildRequires: perl-devel
|
||||
BuildRequires: perl-Term-ReadKey
|
||||
BuildRequires: perl-Tk
|
||||
## AUTOBUILDREQ-END
|
||||
BuildRequires: elfutils-devel
|
||||
BuildRequires: libbzip2-devel
|
||||
BuildRequires: lm_sensors-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-setuptools >= 0.6c5
|
||||
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
|
||||
Requires: perl >= %{perl_major_ver}
|
||||
Requires: perl-Term-ReadKey
|
||||
Provides: netsnmp = %{?epoch:%epoch:}%{version}-%{release}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||
|
||||
# NOTE (autospec tests)
|
||||
# WARNING: /usr/sbin/snmpd
|
||||
# RPATH: /usr/lib/perl5/5.8.7/i386-linux-thread-multi/CORE
|
||||
# WARNING: /usr/sbin/snmptrapd
|
||||
# RPATH: /usr/lib/perl5/5.8.7/i386-linux-thread-multi/CORE
|
||||
|
||||
%description
|
||||
Net-snmp includes various tools relating to the Simple Network Management Protocol:
|
||||
* An extensible agent
|
||||
* An SNMP library
|
||||
* tools to request or set information from SNMP agents
|
||||
* tools to generate and handle SNMP traps
|
||||
* a version of the unix 'netstat' command using SNMP
|
||||
* a graphical Perl/Tk/SNMP based mib browser
|
||||
|
||||
%package gui
|
||||
Group: Graphical Desktop/Applications/Networking
|
||||
Summary: An interactive graphical MIB browser for SNMP
|
||||
Requires: perl-Tk
|
||||
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
|
||||
|
||||
%description gui
|
||||
Net-snmp includes various tools relating to the Simple Network Management.
|
||||
This package contains an interactive graphical MIB browser for SNMP.
|
||||
|
||||
%package utils
|
||||
Group: Applications/Networking
|
||||
Summary: Network management utilities using SNMP
|
||||
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
|
||||
|
||||
%description utils
|
||||
Net-snmp includes various tools relating to the Simple Network Management.
|
||||
This package contains some utilities for managing your network using the SNMP protocol.
|
||||
|
||||
%package -n libnetsnmp
|
||||
Group: System/Libraries
|
||||
Summary: An extensible SNMP library
|
||||
|
||||
%description -n libnetsnmp
|
||||
Net-snmp includes various tools relating to the Simple Network Management.
|
||||
This package contains the extensible SNMP library provided by net-snmp.
|
||||
|
||||
%package -n libnetsnmp-devel
|
||||
Group: Development/Libraries
|
||||
Summary: Development files for %{name}
|
||||
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
|
||||
Obsoletes: net-snmp-devel
|
||||
Provides: net-snmp-devel = %{?epoch:%epoch:}%{version}-%{release}
|
||||
|
||||
%description -n libnetsnmp-devel
|
||||
Net-snmp includes various tools relating to the Simple Network Management.
|
||||
This package contains static libraries and header files need for development.
|
||||
|
||||
%package -n perl-NetSNMP
|
||||
Group: System/Libraries/Perl
|
||||
Summary: Perl modules for net-SNMP
|
||||
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
|
||||
Requires: perl >= %{perl_major_ver}
|
||||
|
||||
%description -n perl-NetSNMP
|
||||
Net-SNMP includes various tools relating to the Simple Network Management Protocol:
|
||||
* An extensible agent
|
||||
* An SNMP library
|
||||
* tools to request or set information from SNMP agents
|
||||
* tools to generate and handle SNMP traps
|
||||
* a version of the unix 'netstat' command using SNMP
|
||||
* a graphical Perl/Tk/SNMP based mib browser
|
||||
This package contains the NetSNMP Perl module.
|
||||
|
||||
%package -n python-netsnmp
|
||||
Group: System/Libraries/Python
|
||||
Summary: Python module for net-snmp
|
||||
Requires: libnetsnmp = %{?epoch:%epoch:}%{version}-%{release}
|
||||
Requires: python >= 2.4
|
||||
|
||||
%description -n python-netsnmp
|
||||
Net-SNMP includes various tools relating to the Simple Network Management Protocol:
|
||||
* An extensible agent
|
||||
* An SNMP library
|
||||
* tools to request or set information from SNMP agents
|
||||
* tools to generate and handle SNMP traps
|
||||
* a version of the unix 'netstat' command using SNMP
|
||||
* a graphical Perl/Tk/SNMP based mib browser
|
||||
|
||||
This package is originally based on the Carnegie Mellon University SNMP implementation (version 2.1.2.1), but has developed significantly since then.
|
||||
This package contains the netsnmp Python module.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
sed -i "s|PYMAKE=python|PYMAKE=%{__python}|" Makefile.in
|
||||
|
||||
%build
|
||||
# see: net-snmp-%{version}/configure --help
|
||||
MIBS="\
|
||||
smux etherlike-mib sctp-mib tcp-mib rmon-mib udp-mib \
|
||||
disman/event-mib mibII/mta_sendmail ip-mib/ipv4InterfaceTable \
|
||||
ucd-snmp/diskio"
|
||||
# ucd-snmp/lmSensors <-- FIXME: compile error
|
||||
# ip-mib/ipv6InterfaceTable ip-mib/ipv6ScopeZoneIndexTable
|
||||
|
||||
%configure \
|
||||
--with-cflags="$RPM_OPT_FLAGS" \
|
||||
--sysconfdir="%{_sysconfdir}/net-snmp" \
|
||||
--with-defaults \
|
||||
--with-logfile="/var/log/snmpd.log" \
|
||||
--with-sys-contact="root@localhost" \
|
||||
--with-persistent-directory=/var/lib/net-snmp \
|
||||
--with-mib-modules="$MIBS" \
|
||||
--with-libwrap=yes \
|
||||
--with-openssl \
|
||||
--with-pic \
|
||||
--enable-shared \
|
||||
--disable-static \
|
||||
--enable-embedded-perl \
|
||||
--enable-ucd-snmp-compatibility \
|
||||
--with-python-modules \
|
||||
--with-perl-modules="INSTALLDIRS=vendor"
|
||||
# --enable-ipv6
|
||||
|
||||
%make -j1
|
||||
|
||||
# remove rpath from compiled perl libs
|
||||
find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \;
|
||||
|
||||
# compile python module
|
||||
pushd python
|
||||
%{__python} setup.py --basedir="../" build
|
||||
popd
|
||||
|
||||
%install
|
||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||
%makeinstall \
|
||||
sysconfdir=%{_sysconfdir}/net-snmp \
|
||||
ucdincludedir=%{_includedir}/ucd-snmp \
|
||||
INSTALL_PREFIX=%{buildroot} \
|
||||
PYMAKE="\
|
||||
%{__python} setup.py install -O1 --skip-build \
|
||||
--root %{buildroot} --install-lib=%{python_sitearch}"
|
||||
|
||||
install -d %{buildroot}/var/lib/net-snmp
|
||||
|
||||
install -D -m 644 EXAMPLE.conf %{buildroot}%{_sysconfdir}/net-snmp/snmpd.conf
|
||||
# > %{buildroot}%{_sysconfdir}/net-snmp/snmptrapd.conf
|
||||
|
||||
install -D -m 744 %{S:1} %{buildroot}%{_initrddir}/snmpd
|
||||
install -D -m 744 %{S:2} %{buildroot}%{_initrddir}/snmptrapd
|
||||
|
||||
install -D -m 644 %{S:3} %{buildroot}%{_sysconfdir}/logrotate.d/snmpd
|
||||
install -D -m 644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/snmptrapd
|
||||
|
||||
packlist=`find %{buildroot} -name .packlist`
|
||||
[ -z "$packlist" ] && exit 1 || cat $packlist | \
|
||||
sed "s,%{buildroot},,g;s,.*/man/.*,&.gz,g" | \
|
||||
sort -u > .packlist && rm -f $packlist
|
||||
|
||||
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
|
||||
for dir in `find %{buildroot} -type d | grep $strid`; do
|
||||
echo "%dir ${dir#%buildroot}" >> .packlist
|
||||
done
|
||||
find %{buildroot}/usr/lib/perl5 -name perllocal.pod -exec rm -f {} \;
|
||||
|
||||
rm -f %{buildroot}%{_bindir}/snmpcheck
|
||||
|
||||
%clean
|
||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||
rm -f .packlist
|
||||
|
||||
%post
|
||||
if [ $1 -eq 1 ]; then
|
||||
#new install
|
||||
# NOTE: the domain name is used as keyword for the ro community
|
||||
sed -i "s/^\(com2sec local .*\) COMMUNITY/\1 `hostname -d`/" \
|
||||
%{_sysconfdir}/net-snmp/snmpd.conf
|
||||
|
||||
# . /etc/sysconfig/rc
|
||||
# . $rc_networkfunctions
|
||||
#
|
||||
# get_interfaces_by_zone
|
||||
# [ ${#ifzone_local[@]} -eq 0 ] && exit 0
|
||||
#
|
||||
# for i in `seq 1 ${#ifzone_local[@]}`; do
|
||||
# get_interface_parameters ${ifzone_local[i-1]}
|
||||
# if [ $? -ne 0 ]; then
|
||||
# echo "\
|
||||
#WARNING: could not determine network parameters for interface ${ifzone_local[i-1]}" 1>&2
|
||||
# continue
|
||||
# fi
|
||||
#
|
||||
# [ $i -eq 1 ] && sed -i "\
|
||||
#s|^com2sec mynetwork .*|com2sec mynetwork $int_network/$int_netmask `hostname -d`|" \
|
||||
# %{_sysconfdir}/net-snmp/snmpd.conf ||
|
||||
# sed -i "/^com2sec mynetwork .*/a\\
|
||||
#com2sec mynetwork $int_network/$int_netmask `hostname -d`" \
|
||||
# %{_sysconfdir}/net-snmp/snmpd.conf
|
||||
# done
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%preun
|
||||
#erase
|
||||
if [ $1 -eq 0 ]; then
|
||||
service snmpd stop >/dev/null 2>&1
|
||||
service snmptrapd stop >/dev/null 2>&1
|
||||
/sbin/chkconfig --del snmpd
|
||||
/sbin/chkconfig --del snmptrapd
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%postun
|
||||
# upgrade
|
||||
if [ $1 -eq 1 ]; then
|
||||
service snmpd condrestart >/dev/null 2>&1
|
||||
service snmptrapd condrestart >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
|
||||
%post -n libnetsnmp -p /sbin/ldconfig
|
||||
%postun -n libnetsnmp -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%dir %{_sysconfdir}/net-snmp
|
||||
%config(noreplace) %{_sysconfdir}/net-snmp/*.conf
|
||||
%{_bindir}/agentxtrap
|
||||
%{_bindir}/net-snmp-create-v3-user
|
||||
%{_bindir}/snmpconf
|
||||
%{_sbindir}/snmpd
|
||||
%{_sbindir}/snmptrapd
|
||||
%{_initrddir}/snmpd
|
||||
%{_initrddir}/snmptrapd
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/*
|
||||
%{_mandir}/man[58]/snmp*d*
|
||||
%{_mandir}/man5/snmp_config.*
|
||||
%{_mandir}/man5/variables*
|
||||
%{_mandir}/man1/agentxtrap.*
|
||||
%{_mandir}/man1/net-snmp-create-v3-user*
|
||||
%{_mandir}/man1/snmpconf.*
|
||||
%doc COPYING FAQ NEWS README
|
||||
%doc README.agent-mibs README.agentx README.snmpv3 README.thread
|
||||
|
||||
%files gui
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/tkmib
|
||||
%{_mandir}/man1/tkmib.*
|
||||
|
||||
%files utils
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/encode_keychange
|
||||
%{_bindir}/fixproc
|
||||
%{_bindir}/net-snmp-cert
|
||||
%{_bindir}/snmp[^c]*
|
||||
%{_mandir}/man1/encode_keychange*.1*
|
||||
%{_mandir}/man1/fixproc.*
|
||||
%{_mandir}/man1/snmp*.1.*
|
||||
%{_mandir}/man5/snmp.conf.*
|
||||
%{_mandir}/man5/variables.*
|
||||
|
||||
%files -n libnetsnmp
|
||||
%defattr(-,root,root)
|
||||
%dir %{_datadir}/snmp
|
||||
%{_datadir}/snmp/*
|
||||
%{_libdir}/libsnmp.so.*
|
||||
%{_libdir}/libnetsnmp.so.*
|
||||
%{_libdir}/libnetsnmpagent.so.*
|
||||
%{_libdir}/libnetsnmphelpers.so.*
|
||||
%{_libdir}/libnetsnmpmibs.so.*
|
||||
%{_libdir}/libnetsnmptrapd.so.*
|
||||
%dir /var/lib/net-snmp
|
||||
|
||||
%files -n libnetsnmp-devel
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/net-snmp-config*
|
||||
%{_includedir}/net-snmp/
|
||||
%{_includedir}/ucd-snmp/
|
||||
%{_libdir}/libsnmp.la
|
||||
%{_libdir}/libsnmp.so
|
||||
%{_libdir}/libnetsnmp.la
|
||||
%{_libdir}/libnetsnmp.so
|
||||
%{_libdir}/libnetsnmpagent.la
|
||||
%{_libdir}/libnetsnmpagent.so
|
||||
%{_libdir}/libnetsnmphelpers.la
|
||||
%{_libdir}/libnetsnmphelpers.so
|
||||
%{_libdir}/libnetsnmpmibs.la
|
||||
%{_libdir}/libnetsnmpmibs.so
|
||||
%{_libdir}/libnetsnmptrapd.la
|
||||
%{_libdir}/libnetsnmptrapd.so
|
||||
%{_mandir}/man3/*
|
||||
%{_mandir}/man1/net-snmp-config*.1.*
|
||||
%doc AGENT.txt ChangeLog CodingStyle PORTING README.thread TODO
|
||||
|
||||
%files -n perl-NetSNMP -f .packlist
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/ipf-mod.pl
|
||||
%{_bindir}/mib2c
|
||||
%{_bindir}/mib2c-update
|
||||
%{_bindir}/traptoemail
|
||||
%{_mandir}/man1/traptoemail*.1*
|
||||
%{_mandir}/man[15]/mib2c*
|
||||
|
||||
%files -n python-netsnmp
|
||||
%defattr(-,root,root)
|
||||
%{python_sitearch}/netsnmp/
|
||||
%{python_sitearch}/netsnmp_python-*/
|
||||
|
||||
%changelog
|
||||
* Sun Oct 21 2012 Automatic Build System <autodist@mambasoft.it> 5.7.2-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
* Sun Oct 02 2011 Automatic Build System <autodist@mambasoft.it> 5.7.1-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
* Sun Jul 24 2011 Automatic Build System <autodist@mambasoft.it> 5.7-1mamba
|
||||
- update to 5.7
|
||||
|
||||
* Wed Oct 20 2010 Davide Madrisan <davide.madrisan@gmail.com> 5.6-1mamba
|
||||
- update to 5.6
|
||||
- unable additional mib modules available on the Linux platform
|
||||
- install the perl modules with INSTALLDIRS=vendor
|
||||
- enable tcp_wrappers support
|
||||
- created subpackages %{name}-utils, and %{name}-gui
|
||||
|
||||
* Sun Aug 08 2010 Automatic Build System <autodist@mambasoft.it> 5.5-1mamba
|
||||
- update to 5.5
|
||||
|
||||
* Sun Aug 08 2010 Automatic Build System <autodist@mambasoft.it> 5.4-6mamba
|
||||
- automatic rebuild by autodist
|
||||
|
||||
* Wed Mar 11 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-5mamba
|
||||
- automatic rebuild by autodist
|
||||
|
||||
* Tue Nov 18 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-4mamba
|
||||
- commented use of function script in %post to avoid unresolved executable requirements for internal functions
|
||||
|
||||
* Mon Nov 10 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-3mamba
|
||||
- automatic rebuild by autodist
|
||||
|
||||
* Thu Apr 19 2007 Davide Madrisan <davide.madrisan@gmail.com> 5.4-2mamba
|
||||
- update initscripts
|
||||
- fix package license
|
||||
- do not build static libraries
|
||||
- own %{_includedir}/net-snmp and %{_includedir}/ucd-snmp
|
||||
- use service to call snmpd and snmptrapd initscripts
|
||||
|
||||
* Wed Mar 28 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 5.4-1mamba
|
||||
- update to version 5.4 by autospec
|
||||
- perl-NetSNMP: don't obsolete perl-Net-SNMP
|
||||
- added libnetsnmp and libnetsnmp-devel subpackages, obsoleted netsnmp-devel
|
||||
- removed patch against CVE-2005-2177 (fixed upstream)
|
||||
|
||||
* Wed Jan 11 2006 Davide Madrisan <davide.madrisan@qilinux.it> 5.2.1.2-2qilnx
|
||||
- rebuilt
|
||||
|
||||
* Mon Oct 03 2005 Davide Madrisan <davide.madrisan@qilinux.it> 5.2.1.2-1qilnx
|
||||
- update to version 5.2.1.2 by autospec
|
||||
- also fix the security flaw QSA-2005-113 (CAN-2005-2177)
|
||||
- security fix: do not create unsafe temporary files
|
||||
|
||||
* Wed Apr 27 2005 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-4qilnx
|
||||
- rebuild with perl 5.8.6 (see: `net-snmp-config --agent-libs')
|
||||
|
||||
* Wed Jan 19 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2-3qilnx
|
||||
- added missing perl requires and buildrequires
|
||||
|
||||
* Fri Dec 10 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-2qilnx
|
||||
- moved some documentation files to the devel package
|
||||
|
||||
* Fri Dec 03 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.2-1qilnx
|
||||
- update to version 5.2 by autospec
|
||||
|
||||
* Sun Oct 31 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-8qilnx
|
||||
- fix snmptrapd logrotate script (was in fact snmpd script and made logrotate fail)
|
||||
|
||||
* Thu Jul 22 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-7qilnx
|
||||
- post script fixed
|
||||
|
||||
* Tue Jul 20 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-6qilnx
|
||||
- post script modified to support multiple local interfaces
|
||||
|
||||
* Mon Jul 05 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-5qilnx
|
||||
- added snmptrapd initscript
|
||||
- added logrotate configuration files for snmpd and snmptrapd logs
|
||||
- some specfile fixes, preun and postun scripts updated
|
||||
|
||||
* Wed Jun 30 2004 Davide Madrisan <davide.madrisan@qilinux.it> 5.1.1-4qilnx
|
||||
- package perl-Net-SNMP renamed to perl-NetSNMP
|
||||
- post, preun, postun scripts fixed
|
||||
|
||||
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-3qilnx
|
||||
- minor dependencies errors fixed
|
||||
|
||||
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-2qilnx
|
||||
- rebuilt with perl modules package
|
||||
|
||||
* Fri Apr 30 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.1-1qilnx
|
||||
- new version build
|
||||
|
||||
* Wed Apr 28 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1-2qilnx
|
||||
- rebuilt with enable-ucd-snmp-compatibility
|
||||
|
||||
* Wed Dec 03 2003 Davide Madrisan <davide.madrisan@qilinux.it> 5.1-1qilnx
|
||||
- rebuilt with latest version
|
||||
|
||||
* Fri Oct 31 2003 Davide Madrisan <davide.madrisan@qilinux.it> 5.0.9-2qilnx
|
||||
- added `--with-mib-modules="smux"' required by zebra
|
||||
post, preun, postun scripts updated
|
||||
|
||||
* Mon Oct 06 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 5.0.9-1qilnx
|
||||
- new version build
|
||||
|
||||
* Mon Jun 09 2003 Silvan Calarco <silvan.calarco@qinet.it> 5.0.8-2qilnx
|
||||
- added automatic configuration %post script
|
||||
|
||||
* Mon Jun 09 2003 Silvan Calarco <silvan.calarco@qinet.it> 5.0.8-1qilnx
|
||||
- creation of net-snmp package
|
63
net-snmpd.initscript
Normal file
63
net-snmpd.initscript
Normal file
@ -0,0 +1,63 @@
|
||||
#! /bin/bash
|
||||
#
|
||||
# snmpd -- start/stop the Simple Network Management Protocol daemon
|
||||
# chkconfig: 2345 55 15
|
||||
# description: Simple Network Management Protocol
|
||||
# processname: snmp
|
||||
# pidfile: /var/run/snmp.pid
|
||||
# config: /etc/net-snmp/snmpd.conf
|
||||
|
||||
# source function library
|
||||
. /etc/sysconfig/rc
|
||||
. $rc_functions
|
||||
|
||||
NAME=snmpd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
DAEMONPID=/var/run/$NAME.pid
|
||||
DAEMONCONF=/etc/net-snmp/snmpd.conf
|
||||
DAEMONLOG=/var/log/snmpd.log
|
||||
OPTIONS="-Lsd -Lf $DAEMONLOG -c $DAEMONCONF -p $DAEMONPID -a"
|
||||
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
|
||||
|
||||
# check if the snmpd conf file is present
|
||||
[ -r $DAEMONCONF ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n $"Starting $NAME: "
|
||||
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
|
||||
;;
|
||||
stop)
|
||||
echo -n $"Stopping $NAME: "
|
||||
killproc -p $DAEMONPID $DAEMON
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID
|
||||
;;
|
||||
restart|force-reload|reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
condrestart)
|
||||
[ -e /var/lock/subsys/$NAME ] && $0 restart
|
||||
;;
|
||||
status)
|
||||
statusproc $DAEMON
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|restart|condrestart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
8
net-snmpd.logrotate
Normal file
8
net-snmpd.logrotate
Normal file
@ -0,0 +1,8 @@
|
||||
/var/log/snmpd.log {
|
||||
weekly
|
||||
rotate 5
|
||||
copytruncate
|
||||
compress
|
||||
notifempty
|
||||
missingok
|
||||
}
|
63
net-snmptrapd.initscript
Normal file
63
net-snmptrapd.initscript
Normal file
@ -0,0 +1,63 @@
|
||||
#! /bin/bash
|
||||
#
|
||||
# snmptrapd -- start/stop the Simple Network Management Protocol Trap daemon
|
||||
# chkconfig: 2345 55 15
|
||||
# description: Simple Network Management Protocol TRAP and INFORM messages
|
||||
# processname: snmptrapd
|
||||
# pidfile: /var/run/snmptrapd.pid
|
||||
# config: /etc/net-snmp/snmptrapd.conf
|
||||
|
||||
# source function library
|
||||
. /etc/sysconfig/rc
|
||||
. $rc_functions
|
||||
|
||||
NAME=snmptrapd
|
||||
DAEMON=/usr/sbin/$NAME
|
||||
DAEMONPID=/var/run/$NAME.pid
|
||||
DAEMONCONF=/etc/net-snmp/snmptrapd.conf
|
||||
DAEMONLOG=/var/log/snmptrapd.log
|
||||
OPTIONS="-Lf $DAEMONLOG -c $DAEMONCONF -p $DAEMONPID"
|
||||
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
|
||||
|
||||
# check if the snmpd conf file is present
|
||||
[ -r $DAEMONCONF ] || exit 0
|
||||
|
||||
RETVAL=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n $"Starting $NAME: "
|
||||
daemon --pidfile=$DAEMONPID $DAEMON $OPTIONS
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME
|
||||
;;
|
||||
stop)
|
||||
echo -n $"Stopping $NAME: "
|
||||
killproc -p $DAEMONPID $DAEMON
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME $DAEMONPID
|
||||
;;
|
||||
restart|force-reload|reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
condrestart)
|
||||
[ -e /var/lock/subsys/$NAME ] && $0 restart
|
||||
;;
|
||||
status)
|
||||
statusproc $DAEMON
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: ""/etc/init.d/$NAME {start|stop|status|restart|condrestart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
8
net-snmptrapd.logrotate
Normal file
8
net-snmptrapd.logrotate
Normal file
@ -0,0 +1,8 @@
|
||||
/var/log/snmptrapd.log {
|
||||
weekly
|
||||
rotate 5
|
||||
copytruncate
|
||||
compress
|
||||
notifempty
|
||||
missingok
|
||||
}
|
Loading…
Reference in New Issue
Block a user