Welcome to It-Slav.Net blog
Peter Andersson
peter@it-slav.net

I've already got a female to worry about. Her name is the Enterprise.
-- Kirk, "The Corbomite Maneuver", stardate 1514.0
03
Nov

Someone said that the best way to know that you are successful is when someone copy you.

Now I found that a “new” doamin exist, it-slav.se.

According to whois it was registred Jan 2007

domain: it-slav.se
created: 2007-01-18
modified: 2008-06-17
expires: 2009-01-18

And it-slav.net
Record created: 31 MAY 2000
Record last changed: 31 MAR 2008
Record expires: 31 MAY 2017

So after seven years someone found it worth to copy a winner, thanks!!

Filled Under: it-slav.net
02
Nov

I do not like spam.

This a problem that grows and there are many technologies how to fight it.

As I’m the sysadmin of my mailserver it makes it possible to use many approaches. The best way is to find out if it is a spam before it is accepted at the SMTP server. I’m using a Fairly-Secure Anti-SPAM Gateway Using OpenBSD, Postfix, Greylisting, Amavisd-new, SpamAssassin, Razor and DCC and it is very effective.

  • The first filter is to check if the receiver of the mail is valid. It might seem like a obvious first filter but in many cases the host that receives mails from internet only forward the mail to an inner mail server and suddenly invalid mails with probably incorrect from address is the receiving organizations problem. With this approach a valid mail but misspelled to address will bounce back to the sender. If it is a spam mail it will be the sending hosts problem how to handle. I graph this and it can be found here. A qualified guess is that more or less all of them are spams.
  • The second step is a little bit more complex, the mail is scanned before it is accepted. So if my spam scanner finds that the mail is a spam it will tell the sending mailserver that it-slav.net thinks that this mail is a spam and that it is not accepted. If nothing suspicious is found the mailserver accept the mail and it will be sent to my mailserver. The number of mails that are scanned and a spam is found is graphed and it can be found here.
  • A third technology I have used is greylistening, it is very effective but the technologies described above is good enough for me so I’m not using it now. It puts a little more burden on the sending host and the first time a host sends a mail to a new host it will take some extra time.
  • A promising technlogy is SPF, the idea is to guarantee that the sending mail comes from the place were it claims to come from, a good description can be found at wikipedia. Spamassassin use SPF. If you want to avoid that your domain can be used as the sender of a spam, add some extra lines to your DNS record.
  • To annoy spamsenders a good idea could be to start a tarpit. Send all spammsenders to your tarpitt and enjoy when they use their resources for nothing. It is included in OpenBSD in compination with greylistening.

Graphs

Update 2019-05-16
Got an email with a link to What SPF Resources Are Available Now That OpenSPF.org Is Gone?, I recommend reading it.

01
Nov

To make my computer to be able to use the 1-wire protocol I’m using OWFS. The packages to get it running on CentOS5 or RHEL5 can be found here. It has several options and I like the client-server model mainly because it is easy to use the 1-wire stuff in perl in his case.

To start the owfs server I put the following line in /etc/rc.local
/usr/sbin/owserver -u -C --usb_regulartime -p 3001

A good idea to browse the 1-wire bus is to use owhttp and a webbrowser. Start the owhttpd with
/usr/sbin/owhttpd -s localhost:3001 -p 12345
and use a webbrowser to cennect to http://the-host-that-is-running-owhttpd:12345

If you prefer to use files to communicate with the 1-wire bus start the owfs with
/usr/sbin/owfs -s localhost:3001 -m /1-wire

Now you can read the temperature by running
# cat /1-wire/10.DEF05F010800/temperature
4.4375

So now I know that the outdoor temperature is 4.4 degrees Celcius.

01
Nov

It all started with that I wanted to keep track of the temperature in my DataCenter, called PDC (Peters DataCenter), in my basement. I have a couple of computers running 24×7 and if the doors are closed and the outdoor temperature is hot it can get very warm. I have an op5 Monitor system that monitors the temperatue and sends SMS messages and emails if the thresholds are broken.

The first alternative, Sensatronic probes was to expensive for a project like this. After some investigation I stumbled over 1-wire technology and found an excellent shop in Sweden.

01
Nov

In my opinion the only install and forget OS is released in a new version.
Their slogan “Only two remote holes in the default install, in more than 10 years!”
tells what it is all about.
Every release has a song, very often with an ironic touch.
Take a look at the OpenBSD 4.4 changes, download and install.

Buy a CD set or a T-shirt to support this excellent project.

Filled Under: Geek stuff, OpenBSD
31
Oct

[poll id=”1“]

Filled Under: Uncategorized
31
Oct

My collegue Mattias Ryrlén hinted me about a Nagios stat monitor.

It works both with *nix and windows and with op5 Monitor.

You can put it anywhere:

If you hoover over it with your mouse it expands:

Do you want to integrate your perfectly working op5 Monitor or Nagios installation with Asterisk?

I’ve configured op5 Monitor to call me when it detects a problem, to listen to an example click on link below:

11880larm1

The text below is op5 Monitor centric. op5 Monitor is based on Nagios so the principle is the same the only difference in this case is the possibility to test it from the op5 Monitor webconfig GUI.

Here is how I did it.

  1. Have a working asterisk with connected phones
  2. Create a notify script on the op5 Monitor Server or Nagios server

Add the following to misccommands.cfg
# command ‘host-notify-call’
define command{
command_name host-notify-call
command_line sudo -u monitor /opt/monitor/op5/notify/call_asterisk_message.sh ‘A\ message\ from\ Op5\ monitor.\ Host\ “$HOSTNAME$”\ is\ “$HOSTSTATE$”‘
}
and
# command ‘service-notify-call’
define command{
command_name service-notify-call
command_line sudo -u monitor /opt/monitor/op5/notify/call_asterisk_message.sh ‘A\ message\ from\ Op5\ monitor.\ “$SERVICESTATE$”.\ Service\ “$SERVICEDESC$”
\ on\ host\ “$HOSTNAME$”\ is\ $SERVICESTATE$’
}

Comment: sudo to monitor is probably unnecessary but I had som problems with ‘test this service’ in op5 Monitor webconfig GUI because it runs as apache and when the script is run when a problem occour it runs as monitor.

3. call_asterisk_message.sh

ssh dull sudo /root/scripts/make_call3.sh $1

i.e. run make_call3.sh with first argument, dull is my asterisk server.

4. On dull /root/scripts/make_call3.sh

#!/bin/sh
#Creates a phone call via asterisk to a certian number and reads a message

#By Peter Andersson, peter@it-slav.net


echo “$1” | /usr/bin/text2wave -scale 1.5 -F 8000 -o /tmp/$$larm.wav
echo “$1” >/tmp/$$larm.txt
cat <<EOF > /tmp/$$monitorcall.call
Channel: SIP/6000
Callerid: Op5 Monitor
MaxRetries: 5
RetryTime: 60
WaitTime: 60
Application: Playback
Data: /tmp/$$larm
EOF
mv /tmp/$$monitorcall.call /var/spool/asterisk/outgoing
#rm /tmp/$$larm.wav
echo “rm /tmp/$$larm.*” |at now + 1 day #Removes the wav and txt file tomorrow

Comment: 6000 is the phonenumber to call, in my case a softphone.

And now it should work.

31
Oct

I’m testing

Filled Under: Uncategorized




Book reviews
FreePBX 2.5
Powerful Telephony Solutions






Asterisk 1.6
Build a feature rich telephony system with Asterisk






Learning NAGIOS 3.0





Cacti 0.8 Network Monitoring,
Monitor your network with ease!