Community discussions

MikroTik App
 
Maxoni
just joined
Topic Author
Posts: 11
Joined: Thu Jan 30, 2014 3:03 pm

Port Probe

Fri Mar 28, 2014 9:24 am

HI,

I want to check if some port are up or down on my switchs.
To do that i'll create a Probe ( for example ) :

Name : Port 465
Type : TCP
Port : 465
Agent : Default
And i select connect only

I test it on my VM windows server 2008 and my computer ( windows 7 )

But i have some trouble : Some port are not availaible as they were opened ont he machine : i have a message who said me : ( Connection failed : No connection could be made because the target machine actively refused ). ( It's work at the begining...)

Also when i turn off my VM, the probe port still say : Ok.

Did i miss something ?

Thanks.
Last edited by Maxoni on Thu Apr 03, 2014 2:57 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Port Probe

Fri Mar 28, 2014 10:52 am

The probe are useless,

First of all, run this on x86 machine:
/interface ethernet set [ find ] disable-running-check=no 
You can personalize what ethernet or sfp you want to check.

create new functoin called check_ether1:
if(device_property("Ros"),ros_command(":if ([/interface ethernet get [find where default-name=\"ether1\"] value-name=running]) do={:put 1} else={:put 0}"),0)
Create new Probe:
Name: Check ether1
Type: Function
Agent: default
Available: check_ether1()
Error:
if(check_ether1() < 1, "warning", "")
Value: check_ether1()
Unit: (leave blank)

And now you can add probe on the panel "Services" for any device you want.

It also be on graph!


If anyone use this function or probe, please add Karma. Thanks.
 
User avatar
serhio
just joined
Posts: 3
Joined: Thu May 14, 2015 1:03 pm
Contact:

Re: Port Probe

Fri May 15, 2015 12:13 pm

This probe is universal for any device, including switches, routers, Windows servers or workstations:
<?xml version="1.0" ?>
<dude version="4.0beta3">
 <Probe>
  <sys-type>13</sys-type>
  <sys-id>20853</sys-id>
  <sys-name>interfaces port status port 01</sys-name>
  <typeID>5</typeID>
  <snmpProfileID>10001</snmpProfileID>
  <snmpOid>1.3.6.1.2.1.2.2.1.8.1</snmpOid>
  <snmpOidType>integer</snmpOidType>
  <snmpCompareMethod>==</snmpCompareMethod>
  <snmpValueNumber>1</snmpValueNumber>
  <functionAvailable></functionAvailable>
  <functionError></functionError>
  <functionValue></functionValue>
 </Probe>
</dude>
Just change SNMP OID from 1.3.6.1.2.1.2.2.1.8.1 (this one is for first port in system) to number of port you need.

On Windows Severs this number can be high (like 65530), so don't be surprised if you see something like that in SMNP Walker. :)

If port is up, then value is 1. If down, value is 2 and alarm raised.

Probe from original post is to check if some service (and 465 is Secure SMTP) running on device. This is not related to interface port on device.

Who is online

Users browsing this forum: No registered users and 14 guests