devmon icon indicating copy to clipboard operation
devmon copied to clipboard

Package Devmon as an RPM

Open coec opened this issue 5 years ago • 2 comments

Would be great if DEVMON was available as an RPM. (Terabithia maybe)

coec avatar Feb 03 '20 00:02 coec

General ideas

Devmon should support multiple installation

  1. Be installed in the same server as xymon
  2. Should be installed in standalone: devmon only, without xymon
  3. (Should be installed with other opensource app, but is is not ready at all for that)

Xymon dev team (Japheth Cleaver) dixit

(on the Xymon mailing list: https://lists.xymon.com/pipermail/xymon/2021-August/047689.html)

SNMP has long been a requested service to be integrated more closely with xymon, both for discovery and state. With devmon persisting so long, there's absolutely a case (in my mind) for closer tying into the core. I know this has been a priority (at least v1/2) for a while, especially at installations where agent capability is limited.

My 2 cents comment:

  • I dont know if JC was thinking of the official version on Sourceforce or this one....?
  • If you want it, let us know: Post on the Xymon mailing ! https://lists.xymon.com/mailman/listinfo/xymon
  • I reply that I would love to!
    • Including Devmon in Terabithia would be great as it is already packaged
    • This could give to this project some visibility
    • I dont know if the project is ready for that or if it need more developpment (just let me know, waht you think)

bonomani avatar Jun 15 '21 09:06 bonomani

Here's a crude but working RPM spec file for Devmon. Works for me but review and possible cleanup required.

Please excuse the file post...

Name: devmon Version: 0.21.09 Release: 1%{?dist} Summary: Devmon - Monitoring Tool

License: MIT URL: https://github.com/bonomani/devmon Source0: devmon-master.zip Source1: dm_config.pm.patch

BuildRequires: patch BuildRequires: unzip Requires: net-snmp Requires: net-snmp-perl Requires: perl-bignum Requires: perl-Config-IniFiles Requires: perl-IO Requires: perl-libnet Requires: perl-SNMP_Session Requires: perl-Socket Requires: perl-Storable Requires: perl-Time-HiRes Requires: xymon

%description Devmon is a snmp monitoring tool, frequently used with Xymon.

%package templates Summary: Devmon Templates - Additional Templates Requires: devmon = %{version}-%{release} Version: 20230524

%description templates Devmon Templates provides additional monitoring templates for Devmon.

%prep %autosetup -p1 -n devmon-master

%build

%install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d mkdir -p %{buildroot}%{_prefix}/share/devmon mkdir -p %{buildroot}%{_localstatedir}/run/devmon mkdir -p %{buildroot}%{_localstatedir}/lib/devmon mkdir -p %{buildroot}%{perl_vendorlib}/devmon

cp -r %{_builddir}/%{name}-master/devmon %{buildroot}%{_bindir} cp -r %{_builddir}/%{name}-master/devmon.cfg %{buildroot}%{_sysconfdir} cp -r %{_builddir}/%{name}-master/templates %{buildroot}%{_prefix}/share/devmon/ cp -r %{_builddir}/%{name}-master/docs %{buildroot}%{_prefix}/share/devmon/ cp -r %{_builddir}/%{name}-master/extras %{buildroot}%{_prefix}/share/devmon/ cp -r %{_builddir}/%{name}-master/{CHANGELOG,CODE_OF_CONDUCT.md,LICENSE,README.md} %{buildroot}%{_prefix}/share/devmon/ cp %{_builddir}/%{name}-master/extras/devmon.initd.redhat %{buildroot}%{_sysconfdir}/rc.d/init.d/devmon cp -r %{_builddir}/%{name}-master/modules/* %{buildroot}%{perl_vendorlib}/devmon rm -f %{buildroot}%{_prefix}/share/devmon/extras/devmon.initd.redhat find %{buildroot}%{_prefix}/share/devmon/ -type f -exec chmod 0644 {} ;

sed -i -e 's|prog="/usr/local/devmon/devmon"|prog="/usr/bin/devmon"|' %{buildroot}%{_sysconfdir}/rc.d/init.d/devmon sed -i '/FindBin/d' %{buildroot}%{_bindir}/devmon sed -i -e 's|$g{homedir} . "/templates"|"/usr/share/devmon/templates"|' %{buildroot}%{perl_vendorlib}/devmon/dm_templates.pm

cd %{buildroot}%{perl_vendorlib}/devmon/

/usr/bin/patch -p0 < %{SOURCE1}

sed -i '/use dm_config;/i use lib "/usr/share/perl5/vendor_perl/devmon";' %{buildroot}%{_bindir}/devmon

%files %{_bindir}/devmon %{_sysconfdir}/devmon.cfg %{_sysconfdir}/rc.d/init.d/devmon %{_prefix}/share/devmon/docs %{_prefix}/share/devmon/extras %{_prefix}/share/devmon/{CHANGELOG,CODE_OF_CONDUCT.md,LICENSE,README.md} %{_localstatedir}/run/devmon %{_localstatedir}/lib/devmon %{perl_vendorlib}

%files templates %{_prefix}/share/devmon

%changelog

And the patch file contains: --- dm_config.pm.orig 2023-05-24 09:31:27.739891637 +0800 +++ dm_config.pm 2023-05-24 09:35:02.501840015 +0800 @@ -29,7 +29,6 @@ require dm_tests; require dm_templates; use IO::File; -use FindBin; use Getopt::Long; use Sys::Hostname; use Time::HiRes qw(time); @@ -46,9 +45,9 @@

     # General variables
     'version'    => $_[0],                        # set in main script now
  •    'homedir'    => $FindBin::Bin,
    
  •    'configfile' => "$FindBin::Bin/devmon.cfg",
    
  •    'dbfile'     => "$FindBin::Bin/hosts.db",
    
  •    'homedir'    => "/etc/xymon/hostsc.cfg",
    
  •    'configfile' => "/etc/devmon.cfg",
    
  •    'dbfile'     => "/var/lib/devmon/hosts.db",
    
       #        'daemonize'     => 1,
       'foreground'    => 0,
    

@@ -1137,7 +1136,7 @@ &usage if !defined $file; # WHY USAGE, WHY OTHER Test next 3!

 if ( $file !~ /^\/.+/ and !-e $file ) {
  •    my $local_file = $FindBin::Bin . "/$file";
    
  •    my $local_file = "/etc/devmon.cfg";
       $file = $local_file if -e $local_file;
    
    }

coec avatar May 24 '23 05:05 coec