Sunday, October 16, 2016

SCVMM Error "The virtual machine requires local storage and the most appropriate available destination volume connected to host"

  It is a popular error when trying to deploy a virtual machine on Hyper-V Cluster.
  Administrator assumes that the virtual machine will automatically deploy on "Cluster Shared Volume", but it is not.
  To resolve enough to set the option (Hardware Configuration - Advanced - Availability - Make this virtual machine highly available):


Thursday, May 26, 2016

Example perl script parse hylafax errors

In this article I share a script errors parse in the log Hylafax.
This script can be useful to those who are move faxes to Asterisk/Elastix. The script will be sent by e-mail failure fax, missed calls for monitoring.

download hylafax_parse_error.pl

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
#!/usr/bin/perl -w

use warnings;
use MIME::Entity;

my $file = "";
my $tr = 0;
my $CID = "";
my $FaxModem = "";
my $FaxErr = "";
my $PATH_TO_SENDMAIL = "/usr/lib/sendmail";
my @arr_for_tmp = "";
my $cfile_name = "";
my $var = "";
my $count_filename = '/home/Scripts/error_get_count';

open(my $fh, '<', $count_filename) or die "cant open count file";
{
  local $/;
  $content = <$fh>;
}

@cfiles = </var/spool/hylafax/log/c*>;
foreach $cfile (@cfiles) {
  @arr_for_tmp=split /\//,$cfile;
  $cfile_name=$arr_for_tmp[(scalar(@arr_for_tmp))-1];
  $cfile_name =~ s/c//;
  if ($cfile_name > $content) {
   check_processing_jobs($cfile);
  }
}

close $fh;
open($fh, '>', $count_filename) or die "cant open count file";
close $fh;

sub check_processing_jobs
{
 $tr = 0; 
 $file = $_[0];
 open my $info, $file or die "Could not open $file: $!";

 while( my $line = <$info>)  { 
if ($line =~ /CallID/) {
 $CID = $line;     
}
if ($line =~ /FAX CONNECTION  DEVICE/) {
 $FaxModem = $line;     
}
if ($line =~ /error|invalid/) {
 $FaxErr = $line;
 $tr = 1;     
}
}

if ($tr == 1) {
$CID =~ m/^"\d+"\s$/gi;

if ($FaxModem =~ "ttyIAX2") {
   $to_email = "fax_user2\@blogspot.com";
   $data_email = "fax for user2 123456789 ";
}

if ($FaxModem =~ "ttyIAX1") {
   $to_email = "fax_user1\@blogspot.com";
   $data_email = "fax for user1 987654321 ";
}

    $top = MIME::Entity->build(Type    => "multipart/mixed; charset=UTF-8",
       Charset    => "UTF-8",
       From    => "fax\@blogspot.com",
       To      => $to_email,
       Subject => 'fax');
    local $data = "Error " . $data_email . "\n\t" . $CID . "\n\t" . $FaxModem . "\n\t" . $FaxErr;
    $data =~ s/\n+/\n/gi;
    $top->attach(Data => $data);
    open MAIL, "| " . $PATH_TO_SENDMAIL . " -t -oi -oem" or die "open: $!";
    $top->print(\*MAIL);
    close MAIL;
}

close $info;
}

Tuesday, March 29, 2016

Elastix multiple external ip

In this article I want to share the experience to add multiple addresses for Elastix/Asterisk server. This can be used in the following scenarios:
1. A cluster of two Elastix servers (http://www.elastix.com/en/elastix-high-availability-in-detail-2/)
2. Single Elastix server and two voip-provider
3. A cluster of two Elastix servers and two voip-provider

'extrnip' parameter can specify only one IP address in the file sip.conf. Therefore 'externip' in this case is not needed. To use a different address just add routes such as

Server1: internal 192.168.0.1 external_1 192.168.1.1 external_2 192.168.1.2
Server2: internal 192.168.0.2 external_1 192.168.1.5 external_2 192.168.1.5
Virtual IP: external_1 192.168.1.3, isp_1 192.168.1.4, external_2 192.168.1.6, isp_2 192.168.1.7

001
002
ip route add 192.168.1.4/32 via 192.168.1.3 dev eth1 src 192.168.1.3
ip route add 192.168.1.7/32 via 192.168.1.6 dev eth1 src 192.168.1.6

to routes added during the event HA
- create script "/etc/ha.d/resource.d/IProute"

001
002
003
004
005
006
007
008
009
010
#!/bin/bash

args=("$@")

if [ ${args[0]} == "start" ]; then
        ip route add 192.168.1.4/32 via 192.168.1.3 dev eth1 src 192.168.1.3
        ip route add 192.168.1.7/32 via 192.168.1.6 dev eth1 src 192.168.1.6
fi

exit 0

- add script "IProute" to config HA "/etc/ha.d/haresources"

001
voipserver.drbd drbddisk::r0 Filesystem::/dev/drbd0::/replica::ext3 IPaddr::192.168.0.3/24/eth0/192.168.0.255 IPaddr::192.168.1.3/27/eth1/192.168.1.31 IPaddr::192.168.1.6/27/eth1/192.168.1.31 IProute mysqld asterisk httpd elastix-updaterd

Tuesday, March 8, 2016

Exchange 2010/2013 coexistence IIS settings

Some IIS settings must be installed to correct work Exchange 2013.

MBX Servers 2013 (fix display Organization Units in the ECP):

"C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\ecp\web.config"
if no values, setting values <add key="GetListDefaultResultSize" value="2000" />

CAS Servers 2013 (fix access mailboxes on Exchange 2010 from 2013):

"C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\autodiscover\web.config"
"C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\ews\web.config"
if no values, setting values <serverRuntime uploadReadAheadSize="1048576" />


Monday, March 7, 2016

Domain trust over NAT

To create a trust between domains, for example,

blogspot.com, 172.16.0.0/24, nat 10.0.0.0/24 (NS dc01=10.0.0.5, dc02=10.0.0.6)
contoso.com, 192.168.0.0/24, nat 10.0.1.0/24 (NS dc01=10.0.1.5, dc02=10.0.1.6)

you can create a false-DNS server. On false-DNS server create two zones: blogspot.com, contoso.com. On DNS-servers domains blogspot.com, contoso.com create conditional forwarders to false-DNS server.
On false-DNS server:
blogspot.com
Host A - nat IP 10.0.0.5, 10.0.0.6
Host A - dc01 - 10.0.0.5, dc02 - 10.0.0.6
NS - nat IP 10.0.0.5, 10.0.0.6
SRV(_kerberos) - Default-First-Site-Name._sites.dc._msdcs.blogspot.com - dc01.blogspot.com.
SRV(_kerberos) - Default-First-Site-Name._sites.dc._msdcs.blogspot.com - dc02.blogspot.com.
SRV(_ldap) - Default-First-Site-Name._sites.dc._msdcs.blogspot.com - dc01.blogspot.com.
SRV(_ldap) - Default-First-Site-Name._sites.dc._msdcs.blogspot.com - dc02.blogspot.com.
SRV(_ldap) - pdc._msdcs.blogspot.com - dc01.blogspot.com.




contoso.com
analogically

Then create a trust in the usual way.

Sunday, February 21, 2016

Elastix PBX - Batch Configuration error: Secret weak

I want to share a way of import of unsafe passwords in Elastix. We need to comment out the line in the file "/var/www/html/modules/extensions_batch/libs/paloSantoExtensionsBatch.class.php":

001
002
003
004
    //    if (!isset($extension['secret']) || !$this->_valida_password($extension['secret'])) {
    //        $this->errMsg = _tr("Secret weak. Line").": $numLinea";
    //        return FALSE;
    //    }

Wednesday, November 4, 2015

Logparser in CAS Exchange 2013 for users and their version of Outlook

In this article I want to share the search script in logs CAS Exchange 2013 current users and their version of Outlook. The script requires two CAS server, the script must be run under the administrator of these servers, the path to the log specified standard.

Download ex13_username_version.ps1

$cas1 = "cas1.blogspot.com"
$cas2 = "cas2.blogspot.com"
$LogFile = "ex13_username_version.csv"

$LogParser = "C:\Program Files (x86)\Log Parser 2.2\LogParser.exe"
$LogTime = Get-Date -Format "yyyyMMdd"
$LogHProxy = "RpcHttp" + $LogTime + "*.log"
$query = """SELECT DISTINCT EXTRACT_TOKEN(EXTRACT_TOKEN(EventData,1,';'),1,'=') as username,EXTRACT_TOKEN(EXTRACT_TOKEN(EventData,2,';'),1,'}') as client `
         into $($LogFile) FROM '\\$($cas1)\c$\Program Files\Microsoft\Exchange Server\V15\Logging\RpcHttp\W3SVC1\$($LogHProxy)', `
         '\\$($cas2)\c$\Program Files\Microsoft\Exchange Server\V15\Logging\RpcHttp\W3SVC1\$($LogHProxy)' `
         where (EXTRACT_TOKEN(EXTRACT_TOKEN(EventData,1,';'),1,'=') NOT LIKE '%{%' AND EXTRACT_TOKEN(EXTRACT_TOKEN(EventData,1,';'),1,'=') IS NOT null `
         AND EXTRACT_TOKEN(EXTRACT_TOKEN(EventData,2,';'),1,'}') IS NOT null)"""
$LogParserStr = "-i:csv -o:csv " + $query + " –nSkipLines:4"
$LP = Start-Process -FilePath $LogParser -ArgumentList $LogParserStr -Wait -Passthru -NoNewWindow