Koozali.org: home of the SME Server

Smokeping

Offline Brenno

  • ****
  • 208
  • +0/-0
Smokeping
« on: June 23, 2020, 02:50:07 PM »
Has anyone managed to install Smokeping in an ibay?  We used to have this running on a separate Ubuntu VM but I'd like to see if I can get it running on SME.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Smokeping
« Reply #1 on: June 24, 2020, 01:15:05 AM »
Not me.

At a very quick glance 'probably' but haven't checked dependencies.

Give it a go!!

Allow executable content in an ibay etc.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: Smokeping
« Reply #2 on: June 24, 2020, 07:09:06 AM »
Has anyone managed to install Smokeping in an ibay?

What attracts you to smokeping? I am serious; this a straight up question.
- Mark

Offline Brenno

  • ****
  • 208
  • +0/-0
Re: Smokeping
« Reply #3 on: June 24, 2020, 02:06:31 PM »
What attracts you to smokeping? I am serious; this a straight up question.

I want to be able to monitor network latency over time to a handful of hosts.  We have about 15 facilities connected through various ISPs using MPLS or other solutions and I'd like the ability to go back and look at historical performance data.

As I mentioned, we had it on our network before (installed and later removed by another admin) and it was great for giving us a picture of the overall network connectivity.  That being said, if there's an another contrib that provides similar functionality, I'm happy to give it a look.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Smokeping
« Reply #4 on: June 24, 2020, 03:10:31 PM »
Here are my (very!) rough notes on how I set it up.  Still up and running...

Code: [Select]
# 2017-07-07 Install smokeping (unsuccessful / in progress)
# more notes:
# https://www.urban-software.com/cacti-howtos/install-smokeping-on-centos-6/
#
# http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html
# http://office.mmsionline.us/smokeping

# create ibay named "smokeping"
cd /home/e-smith/files/ibays/smokeping/files
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar zxvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
./configure --prefix=/home/e-smith/files/ibays/smokeping

# configure instructed me to run a separate command to download perl modules...
./setup/build-perl-modules.sh /home/e-smith/files/ibays/smokeping/thirdparty

# after perl modules were installed (~4 - 5 minutes)
./configure --prefix=/home/e-smith/files/ibays/smokeping
/usr/bin/gmake install

# edit /home/e-smith/files/ibays/smokeping/etc/config.dist
# set local name and appropriate email addresses
# set mail server to 'localhost'

# install fping
yum install --enablerepo=smecontribs install fping

# create missing directories
mkdir -p /home/e-smith/files/ibays/smokeping/cache
mkdir -p /home/e-smith/files/ibays/smokeping/data
mkdir -p /home/e-smith/files/ibays/smokeping/var

# set secure perms on smokeping_secrets.dist
chmod 400 /home/e-smith/files/ibays/smokeping/etc/smokeping_secrets.dist

# test configuration
cd /home/e-smith/files/ibays/smokeping
./bin/smokeping --config etc/config.dist --debug

# play around with cgi filenames and locations, html filenames and locations, cache and cropper folder locations...
# errors appearing in /var/log/httpd/error_log
 
# 2017-07-07 continue work on smokeping
# copy various ".dist" files
cd /home/e-smith/files/ibays/smokeping/etc
cp smokemail.dist smokemail
cp smokeping_secrets.dist smokeping_secrets
cp tmail.dist tmail
cp basepage.html.dist basepage.html

# edit config to put cache and image folders in "html" instead of "cgi-bin", use copies of files instead of ".dist" versions
imgcache = /home/e-smith/files/ibays/smokeping/html/cache
# imgurl is relative to the location of the cgi file!
imgurl   = ../cache
cgiurl   = https://office.mmsionline.us/smokeping/cgi-bin/smokeping.fcgi

# 2018-02-25 Smokeping Update
# download new version
cd /home/e-smith/files/ibays/smokeping/files
wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.7.1.tar.gz
tar zxvf smokeping-2.7.1.tar.gz
cd smokeping-2.7.1
PERL5LIB=/home/e-smith/files/ibays/smokeping/thirdparty/lib/perl5/
export PERL5LIB
#
# copy 'setup' from 2.6.11, then update perl using
./setup/build-perl-modules.sh /home/e-smith/files/ibays/smokeping/thirdparty
#
./configure --prefix=/home/e-smith/files/ibays/smokeping
make install


Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Smokeping
« Reply #5 on: June 24, 2020, 03:13:00 PM »
You may also want to look at the Cacti contrib

learn more about Cacti: https://www.cacti.net/

Offline Brenno

  • ****
  • 208
  • +0/-0
Re: Smokeping
« Reply #6 on: June 24, 2020, 04:52:02 PM »
You may also want to look at the Cacti contrib

learn more about Cacti: https://www.cacti.net/

I hadn't heard of Cacti before, so I tried to install it but ran into some errors with the install (opened bug 10972).  Thanks for the heads-up.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Smokeping
« Reply #7 on: June 25, 2020, 10:48:30 AM »
Bug link is here.

If I or one of the other in the team get a minute we'll take a look.

https://bugs.contribs.org/show_bug.cgi?id=10972

Can you just tell us exactly what you did when you installed please?
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Brenno

  • ****
  • 208
  • +0/-0
Re: Smokeping
« Reply #8 on: June 25, 2020, 01:50:55 PM »
I just followed the steps from the wiki (https://wiki.contribs.org/Cacti)

Code: [Select]
yum install smeserver-cacti --enablerepo=smecontribs
/etc/e-smith/events/actions/initialize-default-databases
expand-template /etc/e-smith/sql/init/80cacti

That's as far as I got.  I then removed, rebooted and tried again but got the same result.

Offline Brenno

  • ****
  • 208
  • +0/-0
Re: Smokeping
« Reply #9 on: June 25, 2020, 02:17:15 PM »
Additional information, in case it's helpful...

This morning I tried to remove Cacti again using:

Code: [Select]
yum remove smeserver-cacti
and then, per instructions, ran:

Code: [Select]
signal-event post-upgrade
signal-event reboot

As I watched the reboot process through the VSphere Remote Console, I noted the screen freezes on "Loading cacti into mysql".  The console becomes unresponsive, but the server is running fine.  I can still use putty to gain access to the server and server-manager also works.

But, I think it's interesting that on startup the system is still trying to load cacti into mysql despite me removing the contrib.  The cacti_sme database was never created during the install (as noted in the bug report) so this is likely the root of the problem.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Smokeping
« Reply #10 on: June 25, 2020, 05:05:11 PM »
Sounds like the failure in the install did create a basic cacti DB but failed thereafter.

So it did this:

Code: [Select]
CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
And failed later. That was the bit I was going to test.

Simple answer will be to manually remove the remnants of the DB and post-upgrade;reboot

Something like:

Code: [Select]
/usr/bin/mysql
drop database cacti_sme;
drop user cacti@localhost;
flush privileges;

I will try and take a look at this as it seems more sensible to use cacti than smokeping. Just need to find myself a bit of time.

If you want to manually force the DB creation you can probably do something like this

Code: [Select]
/usr/bin/mysql
CREATE DATABASE cacti_sme DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use cacti_sme;
GRANT ALL PRIVILEGES ON cacti_sme.* TO cacti@localhost IDENTIFIED BY 'changeme';
use mysql;
GRANT SELECT ON `mysql`.`time_zone_name` TO 'cacti'@'localhost';
flush privileges;
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline warren

  • *
  • 291
  • +0/-0
Re: Smokeping
« Reply #11 on: June 25, 2020, 10:33:21 PM »
Sounds like the failure in the install did create a basic cacti DB but failed thereafter.

So it did this:

Code: [Select]
CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
And failed later. That was the bit I was going to test.

Simple answer will be to manually remove the remnants of the DB and post-upgrade;reboot

Something like:

Code: [Select]
/usr/bin/mysql
drop database cacti_sme;
drop user cacti@localhost;
flush privileges;

I will try and take a look at this as it seems more sensible to use cacti than smokeping. Just need to find myself a bit of time.

If you want to manually force the DB creation you can probably do something like this

Code: [Select]
/usr/bin/mysql
CREATE DATABASE cacti_sme DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use cacti_sme;
GRANT ALL PRIVILEGES ON cacti_sme.* TO cacti@localhost IDENTIFIED BY 'changeme';
use mysql;
GRANT SELECT ON `mysql`.`time_zone_name` TO 'cacti'@'localhost';
flush privileges;

Have posted to the bug.
I checked an older rpm i had for this contrib and  /etc/e-smith/templates/etc/e-smith/sql/init/80cact  looks like this:

Quote
# cat -n 80cacti
     1  {
     2      my $db = $cacti{DbName} || 'cacti_sme';
     3      my $user = $cacti{DbUser} || 'cacti';
     4      my $pass = $cacti{DbPassword} || 'changeme';
     5      $OUT .= <<END
     6  #! /bin/sh
     7      if [ -d /var/lib/mysql/$db ]; then
     8        exit
     9      fi
    10      /usr/bin/mysql <<EOF
    11      CREATE DATABASE $db DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    12      use $db;
    13      use mysql;
    14      GRANT ALL PRIVILEGES ON $db.* TO $user\@localhost
    15              IDENTIFIED BY '$pass';
    16      flush privileges;
    17  EOF
    18      /usr/bin/mysql $db < /etc/e-smith/db/configuration/migrate/80cacti_sme.sql
    19  END


Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Smokeping
« Reply #12 on: June 26, 2020, 12:47:09 AM »
Thanks.

My guess is it is probably right but there's a syntax error or similar.

It was undoubtedly added for a reason. I need to check the spec file & changelog and see why.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: Smokeping
« Reply #13 on: June 27, 2020, 05:09:09 PM »
I've updated Bug 10972

1. Install the contrib as described in the wiki
Code: [Select]
yum install smeserver-cacti --enablerepo=smecontribs
2. Create a database password
Code: [Select]
config setprop cacti DbPassword $(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;)
3. Create a corrected copy of the template
  [edited 2020-07-04 to include the command that creates the custom template folder]
Code: [Select]
# create the custom template folder
mkdir -p /etc/e-smith/templates-custom/etc/e-smith/sql/init/

# copy and customize the default template into the custom template folder
sed -e 's/DbName/DbDatabase/' \
    -e 's/\([^\]\)@/\1\\@/' \
    -e 's/`mysql`.`time_zone_name`/mysql.time_zone_name/' \
    -e 's|/etc/e-smith/db/configuration/migrate/80cacti_sme.sql|/usr/share/doc/cacti-1.1.19/cacti.sql|' \
    /etc/e-smith/templates/etc/e-smith/sql/init/80cacti \
    > /etc/e-smith/templates-custom/etc/e-smith/sql/init/80cacti

4. Re-expand the cacti db.php config to get the new password configured
Code: [Select]
expand-template /etc/cacti/db.php
5. Initialize the database
Code: [Select]
service mysql.init restart
NOTE: you need to drop the database using mysql -e "drop database cacti_sme;" if it already exists or the initialize step is skipped...

6. Reboot to update the web server
Code: [Select]
signal-event post-upgrade; signal-event reboot

This still leaves the system wanting:
* a newer version of mysql (preferred version = 5.6+)
* several other performance-related changes to the mysql config
* configuration to get it to start working

...but it seems to be up and running.
« Last Edit: July 04, 2020, 01:32:06 PM by mmccarn »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Smokeping
« Reply #14 on: June 28, 2020, 02:11:03 PM »
Thanks Mike.

I'll try & take a look.

Brian is working on migrating contribs to v10. Feel free to join in the chat in Rocket. We need help testing.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation