Архив категории ‘Perl’

Nagios style plugin for Solace Router monitoring

Tuesday, March 21st, 2017

Honor is dead. But I'll see what I can do.

Brandon Sanderson «Words of Radiance»

solace monitoringSolace documentation contains information on some Nagios integration options and a mythical plugin for monitoring Solace from Nagios. But this plugin can not be obtained from Solace site and even from Solace support. The exact quotation from Solace support sounds as "our Nagios plugins are not a product, they are projectware that we provide as part of a paid services engagement related to integration with Nagios". Quite uncomfortable, huh.

So I have prepared own Nagios style plugin (it can obviously be used in Icinga, Shinken etc.) which covers all our needs. It makes use of SEMPv1 management protocol. This protocol is described as legacy in the official documentation but SEMPv2 is not ready yet for usage.

 

(more…)

Метки: ,
Категория: Linux, Perl | Нет комментариев »


How to monitor Linux network quality for different directions

Wednesday, December 7th, 2016

The legends have two problems. They are not believed in or they are believed in too much.

Alexey Pehov «The Sentinel»

tcp-retrans

Sometimes we might need to know if the network connection between our host and other peers is good enough. The main quality attributes of the network connection are badwidth (quite easy to explore) and the packet loss rate (quite difficult to explore). Of course we can monitor the overall TCP retransmit rate (for example using something like netstat -s | grep -i retrans), build the graph and stare at it. But we'll never know which direction is loosing the packets and where is the problem itself.

I have not found the ready-to-use solution and created my own. You can see the results right here on the screenshot.

 

(more…)

Метки: ,
Категория: Linux, Perl | Нет комментариев »


How to migrate XWIki and DokiWiki to Confluence: still easy and for free

Wednesday, May 11th, 2016

Nothing had ever been so welcome by its absence.

Dan Simmons «The Rise of Endymion»

xwiki-dokuwiki-confluenceI am surely aware of the UWC project but I just wasn't satisfied with the results. So I have created my own tool to migrate articles from XWiki and Dokuwiki to Confluence. The tool is quite simple, it doesn't deal with editing history and just migrates the current information. This was my goal and it was achieved. So if you are interested in this – look into the project WikiLumper which is available on GitHub. 

And if you have something to contribute then please contribute.

Метки: ,
Категория: Perl | Нет комментариев »


How to migrate from YouTrack to Jira: easy and for free

Tuesday, April 19th, 2016

It occurs to me that our survival may depend upon our talking to one another.

Dan Simmons «Hyperion»

YTJiraIt's a kind of weird that there is no clear and tested procedure to migrate from Jetbrains YouTrack to Atlassian Jira. The recent one's documentation proposes us to export issues from YT to the CSV file and import it back to Jira. This could be the appropriate solution for those who doesn't need the comments, attachments, issue links and other useful things accumulated over many years of team work. But the real Jedis should follow their own path. So did I. I have made my own tool for migrating from YT to Jira and published in on GitHub. It is called Lumper and if you're here just for making the job done then follow the link, read the README and use it for a good purpose.

(more…)

Метки: ,
Категория: Perl | Нет комментариев »


Perl CGI: How to asynchronously upload multiple files

Monday, March 14th, 2016

If you pass by then just pass by.

Alexey Ivanov «Dormitory-on-Blood»

async

This is a quite frequently used control in the modern web UIs. The user just selects file or files as usual but then he has no need to submit the form and wait for the page to reload. The files are uploaded immediately by Ajax and the result can be seen immediately too.

jQuery makes this task trivial from the frontend point of view but the server side is not so clear. Especially if you use Perl. So I will try eliminate the lack of information with this small post.

(more…)

Метки: ,
Категория: Perl, Web-dev | 2 Комментариев »


How to stop worrying and make your own Perl FIX client

Tuesday, July 28th, 2015

You do the little job you're trained to do.
Pull a lever.
Push a button.
You don't understand any of it, and then you just die.

Chuck Palahniuk «Fight Club»

Keep-Calm-No-Quick-Fix-257x300

This story began with the situation when I needed to make my own FIX (Financial Information eXchange) client for some testing purposes. It was considered to be light and simple so Java/QuickFix and the similar implementaions were dismissed and I started to look for some other options. For some time I was considering Python QuickFix module but this module is just a wrapper for Python to use native C libraries so this option was dismissed too.

Then I looked through CPAN to find some Perl modules (I was always thinking that CPAN contains every module for Perl you can just imagine but this is not true of course) and still no luck. So I decided to create my own module and made it. 

I will not dive into details. Please visit the corresponding GitHub or CPAN pages if you are interested. There you can find the description, synopsis and examples.

(more…)

Метки:
Категория: Perl | Нет комментариев »


Автоматическое выкачивание новых серий любимых сериалов

Friday, November 7th, 2014

Извините! Я почему вредный был? Потому что у меня велосипеда не было! А теперь я сразу добреть начну.

м/ф «Трое из Простоквашино»

bicycleНекоторое время назад на некоторых ресурсах (в основном на Хабре) на глаза несколько раз попадались посты о том, как организовать автоматическое скачивание новых серий, которые появляются на сериальных торрент-трекерах. В основном речь шла о ресурсе lostfilm.tv, и суть метода состояла в периодическом парсинге RSS-ленты, обнаружении ссылок на новые серии нужных сериалов, скачивание торрент-файлов и подкладывании их в некоторое место, откуда их может забрать в работу торрент-клиент.

Идея показалась мне интересной, а реализация – скучной, так что мысль о своём велосипеде в фоновом режиме жила в голове несколько месяцев, а недавно за пару дней реализовалась в рабочий вариант.

 

(more…)

Метки: ,
Категория: Linux, Perl | 2 Комментариев »


Perl: как отдать Excel-файл из CGI-сценария

Friday, March 21st, 2014

Our purpose for living is to find that perfection and show it forth. // Смысл жизни в том, чтобы достигнуть совершенства и рассказать об этом другим.

Ричард Бах «Чайка по имени Джонатан Ливингстон»

perl-camel-xls

Новая микрозаметка из мира Perl, растерявшего в последнее время былую популярность, но не мой интерес и нежные чувства. На этот раз о том, как сгенерировать XLS-файл по запросу в CGI-сценарий о отдать его пользователю в виде аттачмента.

Сам процесс создания файла ложится на плечи модуля Spreadsheet::WriteExcel, о котором всю подробную документацию можно прочитать на CPAN.

Вот, собственно, сам сниппет с комментариями.

(more…)

Метки:
Категория: Perl | Нет комментариев »


Миграция пользователей Atlassian Jira на LDAP

Thursday, December 26th, 2013

Это будет самая замечательная миграция! Я покажу вам свои любимые забегаловки… А знаете, я поменяю цвет, когда подсохнет грибок на моей шкурке!..

м/ф «Ледниковый период»

migrationМиграция пользователей, хранящихся в локальной директории в Jira на LDAP-сервер (AD либо OpenLDAP) не вызовет никаких трудностей, если логины этих пользователей совпадают в Jira и на LDAP-сервере. В этом случае надо просто настроить новую User Directory в Jira и поменять ей приоритет на самый высокий, чтобы аутентификация сперва проходила через неё. Если же есть пользователи, у которых в Jira один логин, а в том же Active Directory – другой, то тут вылезет ряд проблем. В основном эти проблемы будут связаны с тем, что LDAP-аккаунт Джирой будет восприниматься как совершенно отдельный пользователь, а все задачи, комментарии и история останутся привязанными к старому пользователю. Посмотрим, как решить эту проблему.

(more…)

Метки: , ,
Категория: Perl | 2 Комментариев »


Автоматический запуск профайлера в New Relic

Tuesday, November 19th, 2013

Нет такого понятия, как честный бой. В бою используют любое преимущество и любую возможность.

Анджей Сапковскийн «Кровь эльфов»

nr-profilerНесколько лет назад я уже писал статью про свой игрушечный Perl'овый скриптик, авторизующийся на странице. Новой практической задачи пришлось ждать довольно долго. Но она появилась. После недавнего обновления клиентов New Relic у них появилась возможность профилировать все потоки приложения (Java, Ruby, да хоть PHP), чтобы была возможность определить, в каких тредах и на каких методах происходит потеря времени. Запуск профайлера производится из веб-интерфейса, куда надо сначала залогиниться. А очень хотелось записывать дампы по расписанию или, допустим, по наступлению некоего события вроде слишком высокого времени ответа или высокой загрузки CPU.

А пол-дела уже и сделано. Осталось припомнить основы работы с модулем LWP::UserAgent и посмотреть firebug'ом, как проходит авторизация, подстановка CSRF-токенов  и отправка форм в интерфейсе New Relic.

 

(more…)

Метки:
Категория: Perl | Нет комментариев »