Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
he-nagios
> he-nagios.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File he-nagios.spec of Package he-nagios
Summary: Host Europe nagios scripts. Name: he-nagios Version: 0.5 Release: 4.el6 License: distributable Group: Utilities/System Distribution: Red Hat and CentOS Vendor: Host Europe GmbH Packager: Alexander Gedak <agd@hosteurope.de> BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Source0: http://ftp.hosteurope.de/he/mh/src/%{name}.tar.gz Requires: python, bc, sudo, nagios-plugins-nwstat, nagios-plugins-nt, nagios-plugins-load, nagios-plugins-dig, nagios-plugins-disk, nagios-plugins-by_ssh, nagios-plugins-procs, nagios-plugins-nagios, nagios-plugins-file_age, nagios-plugins-mailq, nagios-plugins-rpc, nagios-plugins-smtp, nagios-plugins-cluster, nagios-plugins-dummy, nagios-plugins-ping, nagios-plugins-mysql, nagios-plugins-http, nagios-plugins-users, nagios-plugins-time, nagios-plugins-swap, nagios-plugins-icmp, nagios-plugins-tcp, nagios-plugins-ide_smart, nagios-plugins-ssh, nagios-plugins-ntp, nagios-plugins-ups, nagios-plugins-snmp, nagios-plugins-log AutoReqProv: no %description he-nagios provides a set of nagios scripts managed by Host Europe. %define he_user he-nagios %define he_group he-nagios %define he_home /home/he-nagios %prep %setup -q -n %{name}-%{version} %pre getent group %{he_group} >/dev/null || groupadd %{he_group} getent passwd %{he_user} >/dev/null || useradd -g %{he_group} -s /bin/bash -d %{he_home} -m %{he_user} if [[ ! -e "%{he_home}/.bashrc" ]] ; then touch %{he_home}/.bashrc chmod 644 {%he_home}/.bashrc chown %{he_user}:%{he_group} %{he_home}/.bashrc fi cat <<EOT >%{he_home}/.bashrc PATH="/usr/lib/he-nagios/plugins/:/usr/lib/nagios/plugins/:/usr/lib64/he-nagios/plugins/:/usr/lib64/nagios/plugins/:\$PATH" [ -z "\$PS1" ] && return HISTCONTROL=ignoredups:ignorespace shopt -s histappend HISTSIZE=1000 HISTFILESIZE=2000 shopt -s checkwinsize [ -x /usr/bin/lesspipe ] && eval "\$(SHELL=/bin/sh lesspipe)" PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\\$ ' unset color_prompt force_color_prompt if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "\$(dircolors -b ~/.dircolors)" || eval "\$(dircolors -b)" alias ls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi EOT if [[ ! -e %{he_home}/.ssh ]] ; then mkdir -p %{he_home}/.ssh 2>/dev/null chown %{he_user}:%{he_group} %{he_home}/.ssh chmod 700 %{he_home}/.ssh fi echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA2656URj5qGvGdbQyv0o2Sb88lEgwNDOof041FxMD405e5UsK7/imwb4nxib45R3jZqcDdzaBCGhJJWS7xP2w2et7FU65AOQ5O8t0E4ggm8VodBg2fCi48eAE1puvU7NCWu4CGse//IdWkV5jOGUMWRBcdWeTgoQFUQ1EKyDCW+uvpW/qS/2SWaqNcL94oDz8NJh9HUbobiv3TkZzKGLYafu518kgkzZ3Ka1VPbGOaE6Jw2z2jXSF6897ozzzOVgX1Ffd+l1bRYG67j36gEdhfzZXdkbZw028nw+AYsJ9voN+vEOavIehzYN/mMg64Z1XApwsGqQ/nh+rDVXTvvTIkGZvvNQTMRf5nfnBBj+3ydtbt+j3nUnpE91biVIxxOIJoZYqhJ48BRgBGDfykAP0ShOdFpMg+BdHW8TcOQ0jM14zzuX+YECUP99m6fX7kE04UGWR58BngQLPxXzdqwIZV+Ml2eyCx9Dkm9LNZYT3E6zG3QY4fltZVkHhozXMOjrsPUi6XR/k61L04sCyCUSaJpbSM722Sa+tmlO2ag9v9CdtKkK8aXfss2CsYe8sv1GFxe9EpxGh/BqIRXuE/mfr7qQMZewYh+qMP3o4Vohydrj7tSrfPdgP5nRW2Gf/BF8tOJpRs29JNC/0nDpSGOPUKCWMJH85soYr6Rxu1LTp67k=" >%{he_home}/.ssh/authorized_keys chmod 640 %{he_home}/.ssh/authorized_keys chown %{he_user}:%{he_group} %{he_home}/.ssh/authorized_keys if [[ `grep '^MaxStartups' /etc/ssh/sshd_config | wc -l` -eq 0 ]] ; then echo "MaxStartups 20:30:60" >>/etc/ssh/sshd_config /etc/init.d/sshd reload fi SUDO="he-nagios ALL=NOPASSWD: /usr/lib/he-nagios/plugins/check_raid" echo "$SUDO" | while read LINE; do sed -i "s,^$LINE,,g" /etc/sudoers done SUDO="he-nagios ALL=NOPASSWD: /usr/lib/he-nagios/plugins/raid/cron-check_raid.sh" if ! grep "^$SUDO" /etc/sudoers >/dev/null 2>&1 ; then echo "$SUDO" >> /etc/sudoers fi %install rm -rf %{buildroot} mkdir -p ${RPM_BUILD_ROOT}/usr/lib/he-nagios/plugins install -c -m 0755 plugins/check_bonding plugins/check_drbd plugins/check_interface plugins/check_mem plugins/check_mysql_health plugins/check_mysql_Seconds_Behind_Master plugins/check_mysql_Slave_IO_Running plugins/check_mysql_Slave_IO_State plugins/check_mysql_Slave_SQL_Running plugins/check_mysql_sql plugins/check_mysql_Threads_connected plugins/check_nfs_client plugins/check_nfs_server plugins/check_nfsv3.pl plugins/check_nfsv4.pl plugins/check_raid plugins/check_raid_unwanted plugins/check_vcs-faults plugins/check_vcs.pl ${RPM_BUILD_ROOT}/usr/lib/he-nagios/plugins/ mkdir -p ${RPM_BUILD_ROOT}/usr/lib/he-nagios/plugins/raid/ install -c -m 0755 plugins/raid/* ${RPM_BUILD_ROOT}/usr/lib/he-nagios/plugins/raid/ %postun if [ $1 -eq 0 ]; then userdel -r %{he_user} sed -i "s/^%he_user.*//" /etc/sudoers fi %files %defattr(-,root,root) %dir %attr(0755, root, root) /usr/lib/he-nagios %dir %attr(0755, root, root) /usr/lib/he-nagios/plugins /usr/lib/he-nagios/plugins/* %changelog * Tue Sep 13 2012 Alex Gedak <agd@hosteurope.de> - 0.5-4 - Bugfix for check_raid and new version for check_log * Tue Sep 12 2012 Alex Gedak <agd@hosteurope.de> - 0.5-3 - Bugfix for check_raid and new version for check_log * Wed Aug 15 2012 Alex Gedak <agd@hosteurope.de> - 0.5-2 - Added the feature to include swap to check_mem * Mon May 26 2012 Alex Gedak <agd@hosteurope.de> - 0.5-1 - Error in Raidcheck and new check_ro_mounts * Mon Sep 09 2011 Alex Gedak <agd@hosteurope.de> - 0.4-2 - Wrong entry in /etc/sudoers * Tue Jun 06 2011 Alex Gedak <agd@hosteurope.de> - 0.4-1 - Added raid plugin from Host Europe SA * Tue May 04 2011 Alex Gedak <agd@hosteurope.de> - 0.3-12 - Dependency for debian added and Red Hat allways should be the same version. * Tue Apr 26 2011 Alex Gedak <agd@hosteurope.de> - 0.3-11 - Changed check_bonding to parse /sys/class/net/$DEVICE/carrier - Thanks Jonny and Dennis for the tip * Mon Mar 21 2011 Markus Becker <mbk@hosteurope.de> - 0.3-10 - Added check_vcs-faults script. * Fri Mar 04 2011 Alex Gedak <agd@hosteurope.de> - 0.3-9 - Changed a small bug in the output of check_bonding. * Fri Feb 25 2011 Alex Gedak <agd@hosteurope.de> - 0.3-8 - Added the nagios libary path to check_vcs.pl * Wed Feb 23 2011 Alex Gedak <agd@hosteurope.de> - 0.3-7 - Allways same version for red hat and debian * Wed Feb 23 2011 Alex Gedak <agd@hosteurope.de> - 0.3-6 - The user he-nagios was delete after each update * Wed Feb 23 2011 Alex Gedak <agd@hosteurope.de> - 0.3-4 - A few errors - thanks Daniel * Fri Feb 04 2011 Alex Gedak <agd@hosteurope.de> - 0.3-1 - Added depedency for sudo - Removed bug in plugins * Thu Nov 26 2010 Jonny Schulz <js@hosteurope.de> - 0.2-1 - First release.