Centreon atualizado para versão 2.1.12

Foi liberada versão 2.1.12 do Centreon.
Poderá verificar o changelog em: http://www.centreon.com/Development/changelog-2x.html

O procedimento para upgrade é o mesmo já publicado anteriormente. Poderá ler aqui.
Lembre-se (obviamente) de apontar para a nova URL de download (http://download.centreon.com/index.php?id=149) e rodar os comandos como 2.1.12!!

Upgrade da versão do Centreon para 2.1.11

Para fazer o upgrade da versão do Centreon já instalado basta seguir os passos abaixo:

cd /usr/local/src
wget http://download.centreon.com/index.php?id=148
tar -xzf centreon-2.1.11.tar.gz
cd centreon-2.1.11
./install.sh -u /etc/centreon
Seguir as instruções do script (normalmente você irá responder Y para tudo, mas é bom ler a pergunta né!!).
Para finalizar o upgrade voce precisará acessar a interface Web e seguir por mais 3 ou 4 telas.
Simples assim!

Monitoring Quescom Gateways with Nagios

Como não achei nenhum script que permita o monitoramento de Gateways Quescom através do Nagios portanto resolvi escrever um.
Abaixo está o resultado deste trabalho. Por enquanto o script permite fazer 3 tipos de checagens (utilizar o parametro -s para informar a checagem desejada):
  1. gsmsignal - Irá verificar a potencia do sinal GSM em cada Chip instalado (utilizar o parametro -t para informar o chip desejado)
  2. gsminuse - Irá verificar quantos dos 4 canais GSM estão sendo utilizados para chamadas de saida (Used Out) ou entrada (Used In)
  3. voipinusetotal - Irá verificar quantos canais VoIP (SIP/H.323) estão sendo utilizados para entrada ou saida (utilizar o parametro -t para informar o Foreign Gatekeeper desejado, normalmente o primeiro criado será 1 e assim por diante)

#!/usr/bin/perl
# Verifica Informações do Gateway Quescom

use Net::SNMP;
use Getopt::Std;

$script = "check_snmp_quescom";
$script_version = "1.0.0";

$metric = 1;

$ipaddress = "192.168.1.1"; # default IP address, if none supplied
$version = "1"; # SNMP version
$timeout = 2; # SNMP query timeout
$status = 0;
$returnstring = "";
$community = "public"; # Default community string

$oid_comms = ".1.3.6.1.4.1.9622.1.1.4.0";
$oid_gsm_sinal_1 = ".1.3.6.1.4.1.9622.11.2.8.1.7.0.0";
$oid_gsm_sinal_2 = ".1.3.6.1.4.1.9622.11.2.8.1.7.0.1";
$oid_gsm_sinal_3 = ".1.3.6.1.4.1.9622.11.2.8.1.7.0.2";
$oid_gsm_sinal_4 = ".1.3.6.1.4.1.9622.11.2.8.1.7.0.3";
$oid_gsm_status_1 = ".1.3.6.1.4.1.9622.11.2.8.1.5.0.0";
$oid_gsm_status_2 = ".1.3.6.1.4.1.9622.11.2.8.1.5.0.1";
$oid_gsm_status_3 = ".1.3.6.1.4.1.9622.11.2.8.1.5.0.2";
$oid_gsm_status_4 = ".1.3.6.1.4.1.9622.11.2.8.1.5.0.3";
$oid_voip_usedsessions_1 = ".1.3.6.1.4.1.9622.11.3.2.1.6.0.0";
$oid_voip_usedsessions_2 = ".1.3.6.1.4.1.9622.11.3.2.1.6.0.1";
$oid_voip_usedsessions_3 = ".1.3.6.1.4.1.9622.11.3.2.1.6.0.2";
$oid_voip_usedsessions_4 = ".1.3.6.1.4.1.9622.11.3.2.1.6.0.3";
$oid_voip_name_1 = ".1.3.6.1.4.1.9622.11.3.2.1.2.0.0";
$oid_voip_name_2 = ".1.3.6.1.4.1.9622.11.3.2.1.2.0.1";
$oid_voip_name_3 = ".1.3.6.1.4.1.9622.11.3.2.1.2.0.2";
$oid_voip_name_4 = ".1.3.6.1.4.1.9622.11.3.2.1.2.0.3";

# Do we have enough information?
if (@ARGV < 1) {
print "Too few arguments\n";
usage();
}

getopts("h:H:S:C:w:c:t:");
if ($opt_h){
usage();
exit(0);
}
if ($opt_H){
$hostname = $opt_H;
}
else {
print "No hostname (H) specified\n";
usage();
}
if ($opt_S){
$service = $opt_S;
}
else {
print "No Service to Check specified\n";
usage();
}
if ($opt_C){
$community = $opt_C;
}
if ($opt_c){
$critical = $opt_c;
}
else {
print "No critical value specified\n";
usage();
}
if ($opt_w){
$warning = $opt_w;
}
else {
print "No warning value specified\n";
usage();
}

# Create the SNMP session for Host
my ($s1, $e1) = Net::SNMP->session(
-community => $community,
-hostname => $hostname,
-version => $version,
-timeout => $timeout,
);

if ($service eq "gsmsignal"){
if ($opt_t == 1){
$gsmtrunk = $oid_gsm_sinal_1;
$gsmstatus = $oid_gsm_status_1;
}
elsif ($opt_t == 2){
$gsmtrunk = $oid_gsm_sinal_2;
$gsmstatus = $oid_gsm_status_2;
}
elsif ($opt_t == 3){
$gsmtrunk = $oid_gsm_sinal_3;
$gsmstatus = $oid_gsm_status_3;
}
elsif ($opt_t == 4){
$gsmtrunk = $oid_gsm_sinal_4;
$gsmstatus = $oid_gsm_status_4;
}
else {
print "No or Invalid GSM Trunk to check specified\n $gsmtrunkoption";
usage();
}
gsmsignal();
verifygsmsignal();
}

if ($service eq "voipinusetotal"){
if ($opt_t == 1){
$voipusedsessions = $oid_voip_usedsessions_1;
$voipname = $oid_voip_name_1;
}
elsif ($opt_t == 2){
$voipusedsessions = $oid_voip_usedsessions_2;
$voipname = $oid_voip_name_2;
}
elsif ($opt_t == 3){
$voipusedsessions = $oid_voip_usedsessions_3;
$voipname = $oid_voip_name_3;
}
elsif ($opt_t == 4){
$voipusedsessions = $oid_voip_usedsessions_4;
$voipname = $oid_voip_name_4;
}
else {
print "No or Invalid Foreign Gatekeeper to check specified\n $gsmtrunkoption";
usage();
}
voipinusetotal();
verifyvoipinusetotal();
}


if ($service eq "gsminuse"){
gsminuse();
verifygsminuse();
}

# Close the session for Host
$s1->close();

if ($returnstring eq ""){
$status = 3;
}

if ($status == 0){
print "Status is OK $returnstring\n";
# print "$returnstring\n";
}
elsif ($status == 1){
print "Status is a WARNING $returnstring\n";
}
elsif ($status == 2){
print "Status is CRITICAL $returnstring\n";
}
elsif ($status == 3){
print "Status is UNKNOWN $returnstring\n";
}
else{
print "Problem with plugin. No response from SNMP agent.\n";
}

exit $status;


####################################################################
# This is where we gather data via SNMP and return results #
####################################################################

sub gsmsignal {

#######################################################
if (!defined($s1->get_request($oid_comms))) {
}
foreach ($s1->var_bind_names()) {
$temp = $s1->var_bind_list()->{$_};
}
if ($temp eq "SmartIAD"){
}
else {
append("- SNMP agent not communicating with Quescom Gateway");
$statushost = 3;
return 1;
}
#######################################################
if (!defined($s1->get_request($gsmstatus))) {
}
foreach ($s1->var_bind_names()) {
$gsmstatus_result = $s1->var_bind_list()->{$_};
}
#######################################################
if (!defined($s1->get_request($gsmtrunk))) {
}
foreach ($s1->var_bind_names()) {
$gsmtrunk_signal = $s1->var_bind_list()->{$_};
}
}
sub verifygsmsignal {
$issue = "";

if ($gsmtrunk_signal <= $warning) {
$status = 1;
}
if ($gsmtrunk_signal <= $critical) {
$status = 2;
}
if ($gsmstatus_result eq "Inactive") {
$status = 2;
}
if ($statushost == 3) {
$status = 3;
}

my $perfdata="| 'signal'=$gsmtrunk_signal;$warning;$critical;";

if ($status == 0){
$temp = sprintf "$issue - Signal GSM Channel $opt_t ($gsmstatus_result): $gsmtrunk_signal dBm $perfdata";
}
else {
$temp = sprintf "$issue - Signal GSM Channel $opt_t ($gsmstatus_result): $gsmtrunk_signal dBm $perfdata";
}
if ($gsmstatus_result eq "Inactive"){
$temp = sprintf "$issue - Signal GSM Channel $opt_t ($gsmstatus_result): Sem Sinal da Operadora!! $perfdata";
}

append($temp);
}

sub voipinusetotal {

#######################################################
if (!defined($s1->get_request($oid_comms))) {
}
foreach ($s1->var_bind_names()) {
$temp = $s1->var_bind_list()->{$_};
}
if ($temp eq "SmartIAD"){
}
else {
append("- SNMP agent not communicating with Quescom Gateway");
$statushost = 3;
return 1;
}
#######################################################
if (!defined($s1->get_request($voipusedsessions))) {
}
foreach ($s1->var_bind_names()) {
$voipusedsessions_result = $s1->var_bind_list()->{$_};
}
#######################################################
if (!defined($s1->get_request($voipname))) {
}
foreach ($s1->var_bind_names()) {
$voipname_result = $s1->var_bind_list()->{$_};
}
}
sub verifyvoipinusetotal {
$issue = "";

if ($voipusedsessions_result >= $warning) {
$status = 1;
}
if ($voipusedsessions_result >= $critical) {
$status = 2;
}

if ($statushost == 3) {
$status = 3;
}

my $perfdata="| 'voipinuse'=$voipusedsessions_result;$warning;$critical;";

if ($status == 0){
$temp = sprintf "$issue - VoIP Channels In Use for $voipname_result: $voipusedsessions_result $perfdata";
}
else {
$temp = sprintf "$issue - VoIP Channels In Use for $voipname_result: $voipusedsessions_result $perfdata";
}
append($temp);
}

sub gsminuse {

#######################################################
if (!defined($s1->get_request($oid_comms))) {
}
foreach ($s1->var_bind_names()) {
$temp = $s1->var_bind_list()->{$_};
}
if ($temp eq "SmartIAD"){
}
else {
append("- SNMP agent not communicating with Quescom Gateway");
$statushost = 3;
return 1;
}

#######################################################
if (!defined($s1->get_request($oid_gsm_status_1))) {
}
foreach ($s1->var_bind_names()) {
$gsm_status_1 = $s1->var_bind_list()->{$_};
}
#######################################################
if (!defined($s1->get_request($oid_gsm_status_2))) {
}
foreach ($s1->var_bind_names()) {
$gsm_status_2 = $s1->var_bind_list()->{$_};
}
#######################################################
if (!defined($s1->get_request($oid_gsm_status_3))) {
}
foreach ($s1->var_bind_names()) {
$gsm_status_3 = $s1->var_bind_list()->{$_};
}
#######################################################
if (!defined($s1->get_request($oid_gsm_status_4))) {
}
foreach ($s1->var_bind_names()) {
$gsm_status_4 = $s1->var_bind_list()->{$_};
}
}
sub verifygsminuse {
$issue = "";
$gsm_inuse_1 = 0;
$gsm_inuse_2 = 0;
$gsm_inuse_3 = 0;
$gsm_inuse_4 = 0;

if (($gsm_status_1 eq "Used In") || ($gsm_status_1 eq "Used Out")) {
$gsm_inuse_1 = 1;
}
if (($gsm_status_2 eq "Used In") || ($gsm_status_2 eq "Used Out")) {
$gsm_inuse_2 = 1;
}
if (($gsm_status_3 eq "Used In") || ($gsm_status_3 eq "Used Out")) {
$gsm_inuse_3 = 1;
}
if (($gsm_status_4 eq "Used In") || ($gsm_status_4 eq "Used Out")) {
$gsm_inuse_4 = 1;
}

$gsm_inuse_all = $gsm_inuse_1+$gsm_inuse_2+$gsm_inuse_3+$gsm_inuse_4;

if ($gsm_inuse_all >= $warning) {
$status = 1;
}
if ($gsm_inuse_all >= $critical) {
$status = 2;
}

if ($statushost == 3) {
$status = 3;
}

my $perfdata="| 'gsminuse'=$gsm_inuse_all;$warning;$critical;";

if ($status == 0){
$temp = sprintf "$issue - GSM Channels In Use: $gsm_inuse_all $perfdata";
}
else {
$temp = sprintf "$issue - GSM Channels In Use: $gsm_inuse_all $perfdata";
}
append($temp);
}

####################################################################
# help and usage information #
####################################################################

sub usage {
print << "USAGE";
-----------------------------------------------------------------
$script v$script_version

Monitors Quescom GSM Gateways.

Usage: $script -H -s -t -C -w -c

Options: -H Hostname or IP address
-S Service to check (gsmsignal,gsminuse,voipinusetotal)
-t GSM Trunk to check (1,2,3,4) or Foreign Gatekeeper to check (1,2,3,4)
-C Community (default is public)
-w Warning Value
-c Critical Value
-----------------------------------------------------------------
This program is free software; you can redistribute it or modify
it under the terms of the GNU General Public License
-----------------------------------------------------------------

USAGE
exit 1;
}

####################################################################
# Appends string to existing $returnstring #
####################################################################

sub append {
my $appendstring = @_[0];
$returnstring = "$returnstring$appendstring";
}
PS: O script por enquanto suporta apenas a checagem de 4 Chips GSM e 4 Foreign Gatekeeper. Dúvidas? Use rode o script sem parametro para ver o help. Ou deixe um comentário.
If you want this in English, leave a comment below!