Gregory Sloop | 2 Sep 18:55 2011
Picon

SMTP Alerts on alternate port, smtp auth


I'd like to use the Net::SMTP module instead of sendmail - (Just
easier, IMO) and I need to use an alternate port. [Like 26]

Is there some way to configure this? I've searched the lists [and
Google] and was not able to find anything...

One other items that would perhaps be helpful would be SMTP auth
options. Are these in there somewhere?

[My smokeping is running in places where it may not have a local
server where I can send mail, and even if I could, I might prefer to
deliver mail via another non-local server. And further, Port 25
outbound may be blocked.

I know that's a bit odd
given how most people will run it, but that's how I'm running it and
it fits the need/requirements.]

-Greg

--

-- 
Gregory Sloop, Principal: Sloop Network & Computer Consulting
503.251.0452 x82 Voice | 503.251.0452 Fax
www.sloop.net
mailto:gregs <at> sloop.net

_______________________________________________
smokeping-users mailing list
smokeping-users <at> lists.oetiker.ch
(Continue reading)

Gregory Sloop | 2 Sep 21:39 2011
Picon

Re: SMTP Alerts on alternate port, smtp auth

That's neat and all, but it's not clear how I'd include any data on
what the alert is about - what host etc.

I assume that perhaps the mailtemplate might be helpful, but an
initial read of the docs isn't particularly enlightening.

I assume you may have done something similar - do you have some
example code, or can you point me to some?

I'm reasonably proficient in bash, so it's possible I could cobble
something together...

I still think it would be much better to include SMTP alt-port & auth
etc in the code, along with the required extensions - writing a bash
script etc is really an ugly hack.

But if I have to settle for a hack, perhaps it's that or nothing.

-Greg

TT> On 9/2/11 12:55 PM, Gregory Sloop wrote:
>> 
>> I'd like to use the Net::SMTP module instead of sendmail - (Just
>> easier, IMO) and I need to use an alternate port. [Like 26]
>> 
>> Is there some way to configure this? I've searched the lists [and
>> Google] and was not able to find anything...

TT> Greg,

(Continue reading)

Gregory Sloop | 5 Sep 21:25 2011
Picon

Mail script for SMTP Auth, alternate destination ports, etc.


Well, since there wasn't apparently any ready-made scripts for using
an off-site mail server, using SMTP auth or alternate ports, I coded
one in perl. [My first perl code - aren't you lucky! :) ]

I used Mail::Sender - so if you use my script you'll need to install
that from CPAN or somewhere else.

Line wrap is probably going to mangle things a bit, but I think you'll
manage.

I placed this in the same directory as the smokeping config file and set
+execute permissions on the user.

Then, in my smokeping config file, I have a line like this:
to = |/etc/smokeping/smokeping-smtp-auth-alert-0.0.2

This will kick off the perl script. Unfortunately there's no way to
specify the destination etc in the config file, so you'll have to edit
the perl script below.

I've tried to keep the messages minimal, so you can send to SMS
devices. [I need to work on a pattern that will alert me quickly, but
not generate a huge number of alerts - so I'll have a question about
that soon.]

I don't do a lot of error checking [virtually none] in my script, but
even if I did - there's not much one could do about any failures.
Either things work or they don't - an unattended script won't be able
to do much to help.
(Continue reading)

Gregory Sloop | 5 Sep 21:32 2011
Picon

Patterns


I'm looking for a pattern that will alert me quickly of any problems.
Say, <50% packet loss.

I'm more used to Mon's alert system where you can limit the number of
alerts you get - and EdgeTrigger can help - but I'm worried that I'll
miss the first one.

I'd like to get, say 5 alerts, and then no more.

So, anyone have any suggestions?

---
I've tried to create some patterns that would produce an alert every
five minutes [My step time, at least right now, is 60 seconds - which
is probably crazy - but I don't have a lot of hosts and I'm working to
nail down a problem and five minutes seems too large.]

Something that would
1) let me know within five minutes
2) of a loss of 50%+ twice in 10 minutes
3) Would not repeat the alert more than once every 5 minutes.
4) But would let me know at least three times fairly quickly
initially. [Say, every minute, or three.]

I just can't wrap my head around the patterns well enough to build
something like that - if it's even possible.

Any suggestions?

(Continue reading)

Ton Muller | 6 Sep 15:51 2011
Picon

Smoke isnt build website stats ? :(

Greeting.
I got finaly smokeping running on my openBSD box (4.9)
after strugeling with the conf files, i manage to run smokeping.
i see the data in the DB directory.
but smokeping is refusing to build the website in htdocs/smokeping.

any advice??

Below my config
i use smokeping on LAN webserver only.

*** General ***

owner    = Ton Muller
contact  = admin <at> <domain>
mailhost = mail.<domain>
sendmail = /usr/sbin/sendmail
imgcache = /var/www/htdocs/smokeping/img
imgurl   = http://192.168.0.240/smokeping/img
pagedir  = /var/www/htdocs/smokeping
datadir  = /var/db/smokeping
piddir  = /var/run/smokeping
cgiurl   = http://192.168.0.240/../smokeping/cgi-bin/smokeping.cgi
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
# specify this to get syslog logging
syslogfacility = local0
# each probe is now run in its own process
# disable this to revert to the old behaviour
# concurrentprobes = no
(Continue reading)

Ton Muller | 6 Sep 20:18 2011
Picon

Re: Smoke isnt build website stats ? :(

Hello Greg.

Well, lets see.
files in /var/db/smokeling are ok.
755 _smokeping _smokeping, so DB files are ok.

message log says ...nothing....
smokeping CGI directory 755 root deamon, inc cgi and smokeping.cgi
and no error in error.log, so i guess its working.

pagedir for smokeping in htdocs 755 was root deamon :/ ,is now
_smokeping _smokeping. but after 15 minutes still no result
no files written in it.
apache cant serv if smoke isnt writing in it ,hehe..
with the new settings i still can access the smokeping over http.

Regards.

On 6-9-2011 18:24, Gregory Sloop wrote:
> If I were guessing, I'd probably say it's a permission problem with
> TM> imgcache = /var/www/htdocs/smokeping/img
> and
> TM> pagedir  = /var/www/htdocs/smokeping
> 
> Does the user smokeping is running as have rights there?
> 
> Are the files not getting built, or will apache refuse to serve them?
> 
> If the latter, then the apache logs will tell you. If the former, the
> message log should say, _I think._
(Continue reading)

Ton Muller | 6 Sep 21:15 2011
Picon

Re: Smoke isnt build website stats ? :(

Hello.

results..
# ps -auxww | grep "[s]moke"
_smokeping 31627  0.0  0.5 11920  5264 ??  Is     5:43PM    0:00.70
perl: /usr/local/bin/smokeping [FPing] (perl)
you have mail in /var/mail/root
#

2nd.
# ps -auxww | grep "[h]ttp"
www      27021  0.0  0.2  1272  2400 ??  Ss     4:54PM    0:00.29 httpd:
parent [chroot /var/www] (httpd)
www      17660  0.0  0.2  1276  1848 ??  I      4:55PM    0:00.02 httpd:
child (httpd)
www       4155  0.0  0.2  1276  1852 ??  I      4:55PM    0:00.03 httpd:
child (httpd)
www      15314  0.0  0.2  1276  1848 ??  I      4:55PM    0:00.03 httpd:
child (httpd)
www      30267  0.0  0.2  1300  1868 ??  I      4:55PM    0:00.03 httpd:
child (httpd)
www      30841  0.0  0.2  1276  1864 ??  I      4:55PM    0:00.03 httpd:
child (httpd)
www      21725  0.0  0.2  1276  1804 ??  I      5:50PM    0:00.02 httpd:
child (httpd)
www      29482  0.0  0.2  1276  1864 ??  I      5:50PM    0:00.02 httpd:
child (httpd)
www       3385  0.0  0.2  1276  1868 ??  I      5:50PM    0:00.02 httpd:
child (httpd)
www      14873  0.0  0.2  1276  1804 ??  I      6:55PM    0:00.02 httpd:
(Continue reading)

Ton Muller | 6 Sep 22:30 2011
Picon

Re: Smoke isnt build website stats ? :(

hmm, no i didnt.....

# smokeping --debug
Dropping privileges to _smokeping ...
### Compiling alert detector pattern 'startloss'
### ==S,>0%,>0%,>0%
sub {
    my $d = shift;
    my $y = $d->{loss};
    for(1){
        my $minlength = 4;
        my $maxlength = 4;
        next if scalar  <at> $y < $minlength ;
        next unless defined $y->[-4] and $y->[-4] eq 'S';
        next unless defined $y->[-3]
                        and $y->[-3] =~ /^\d/
                        and $y->[-3] > 0;
        next unless defined $y->[-2]
                        and $y->[-2] =~ /^\d/
                        and $y->[-2] > 0;
        next unless defined $y->[-1]
                        and $y->[-1] =~ /^\d/
                        and $y->[-1] > 0;
        return 1;
    }
    return 0;
}

### Compiling alert detector pattern 'rttdetect'
### <10,<10,<10,<10,<10,<100,>100,>100,>100
(Continue reading)

Ton Muller | 6 Sep 22:39 2011
Picon

Re: Smoke isnt build website stats ? :(

uh??
smokeping.log ???
now you mention it..
there is non there.
and for the chrooted, not sure.
i am more a pf guy,hehe..

On 6-9-2011 22:13, Jim Long wrote:
> Just for good measure, I'd suggest stopping smokeping, and then
> checking with ps to ensure that all smokeping processes have
> terminated.  Once all smokeping processes have terminated,
> restart smokeping, to ensure that it is incorporating your latest
> changes.
> 
> How is your logging configured in smokeping?  Are there any
> interesting entries in the smokeping log?  With the standard
> FreeBSD port, the default log location is /var/log/smokeping.log,
> but it could be different on OpenBSD.
> 
> Permissions look acceptable, although not optimal.  The test.html
> wasn't a writeability test -- EVERYTHING is writable by root!  It
> was a test to ensure your Apache is functional, and also to see
> what default group ownership files created there would inherit.
> 
> I note that your Apache is chrooted in /var/www.  I've never done
> that.  I don't know smokeping well enough to know whether the cgi
> script (that runs from the chrooted Apache process) requires
> access to /var/db/smokeping.  If it does, you're hosed, because
> that's outside the chroot.
> 
(Continue reading)

Jim Long | 6 Sep 22:51 2011

Re: Smoke isnt build website stats ? :(

Once you get the big issues sorted, I strongly suggest you iron
out the logging for smokeping.  In FreeBSD, the default log file
is /var/log/smokeping.log.  I don't know whether OpenBSD has
adopted FreeBSD/NetBSD conventions for config options to add-on
software like smokeping, but in FreeBSD, I can set the log file
by specifying a "smokeping_logfile" variable in /etc/rc.conf:

smokeping_enable="yes"
smokeping_logfile="/var/log/smokeping.log"

Check your smokeping start-up script to see what hooks it has
to set a logfile name, if any.

Bottom line, get your smokeping logging straightened out once you
get the bigger issues resolved.  You definitely want smokeping to
be able to log error conditions and progress indicators.

Jim

On Tue, Sep 06, 2011 at 10:39:05PM +0200, Ton Muller wrote:
> uh??
> smokeping.log ???
> now you mention it..
> there is non there.
> and for the chrooted, not sure.
> i am more a pf guy,hehe..
> 
> On 6-9-2011 22:13, Jim Long wrote:
> > Just for good measure, I'd suggest stopping smokeping, and then
> > checking with ps to ensure that all smokeping processes have
(Continue reading)


Gmane