Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - faunsen

#16
/sbin/shutdown -r now should work.
#17
Can you post the monitrc here?
#18
Yes, everything that can be scripted can be monitored.
see Monit Mini Howto
especially the IPMI example
#19
Quote from: jmp20 on May 02, 2019, 09:55:23 PM

client: 192.168.20.20:23456 --> firewall: 127.0.0.1:8021
then from
firewall: 10.10.10.11:45678 --> firewall: 10.10.10.11:21

This looks strange. This should go to the public FTP server via WAN.

The question is why does the firewall redirect FTP to itself?
Routing? Redirects? Reverse address?
#20
Did you set the message body within the mail-format?
https://mmonit.com/monit/documentation/monit.html#Message-format
#21
General Discussion / Re: external monitoring
April 28, 2019, 08:26:44 PM
You could add a Monit service that checks the VPN status and query it via API call.
https://wiki.opnsense.org/development/api.html
https://wiki.opnsense.org/development/api/plugins/monit.html

Or let Monit send notifications per email to your monitoring system.

#22
Quote from: bobbythomas on March 29, 2019, 08:09:30 PM
am receiving receiving ICMP success notifications but not failure notifications. There is no problem with standby internet connectivity and it was working previously with "CHANGED STATUS" condition, but now after the upgrade when I put that I get syntax error. Any suggestions?
I wonder how that worked because CHANGED STATUS is for program tests.

Quote from: bobbythomas on March 29, 2019, 08:09:30 PM
Here is the alert settings config from the monitrc:

set alert abc@gmail.com  { icmp,instance } mail-format { Subject:$SERVICE on $HOST $EVENT (ISP LINK STATE CHANGE) } reminder on 10 cycles

And here is the service and service test settings config:

check host ISP-Link-status address xxx.xxx.xxx.xxx
   if failed ping then alert
Looks fine for me.
Can you ping the ISP address?
Do you get failure notifications if you select all events for abc@gmail.com?
#24
Hallo Holger,

ich nehme an Du möchtest aktives FTP ins Internet machen, richtig?
Hast Du Dich an das HowTo gehalten?


Viele Grüße
Frank
#25
Just an idea.
You could use the Monit Plugin.
Create a test that executes a script on failure. And that script sends the ifconfig output to you.

Unfortunately Monit cannot send script output.
Therefore we send emails from command line via the os-postfix plugin.
Install and enable it.

Then configure Monit:
E.g.
Test
Name: TestWANLink
Condition: failed link
Action: Execute
Path: /usr/local/bin/IfaceAlert.sh "you@domain.tld" vtnet0

In this example "you@domain.tld" is the recipient and vtnet0 is the WAN interface (see Interfaces->Assignments)

Service
Name: WANLink
Type: Network
Interface: WAN
Tests: TestWANLink

The script /usr/local/bin/IfaceAlert.sh could look like this:
#!/bin/csh

( printf "To: $1\nSubject: Interface Link Down\n\n" ; ifconfig $2 ) | sendmail $1


#26
OK, Monit Dashboard Widget ist drin. https://github.com/opnsense/core/commit/b0099843fdbe03296e5b9b26e011e1969f967bb3
Kommt aber erst in Version 18.7.
#27
Quote from: noname12123 on June 25, 2018, 02:52:18 PM
"Restart" habe ich eh schon eingestellt gehabt!

Ich habe alle Möglichkeiten versucht. mit start stop und sogar bei service test settings execute.
leider funktioniert das alles nicht.

bei start/stop wird immer ein absoluter pfad verlangt. somit fällt "configctl interface linkup start <ALIASNAME>" bei start/stop schon mal weg. per execute im service test settings endet mit "syntax error". tja komisch...dabei hat dieses tool einige Möglichkeiten laut online hilfe.

Der Pfad zu configctl lautet /usr/local/sbin/configctl
Ansonsten funktioniert das bei mir tadellos.
Service Test:
Name: PingRestart
Condition: failed ping
Action: Restart

Service:
Name: PingHost
Type: Remote Host
Address: 1.2.3.4
Start: /usr/local/sbin/configctl interface linkup start OPT1
Start: /usr/local/sbin/configctl interface linkup stop OPT1
Tests: Ping

Welche OPNsense und welche os-monit Version hast Du installiert?

Quote from: noname12123 on June 25, 2018, 02:52:18 PM
davon dürfte aber nur sehr wenig davon im tool von opnsense möglich sein. Allein die Einstellung wieviele ping Versuche man machen kann, bis ein Ereignis aussgeführt werden soll, fehlt oder kann ich zumindest nirgends finden. Und das für mich wohl sinnvollste Anwendungsgebiet "ping" -> z.b "3x versucht" -> "error" - "restart Interface igb2" funktioniert anscheinend gar nicht...leider!
Na, na, na. Doku nicht gelesen?  ;)
Monit FAULT_TOLERANCE
Das os-monit plugin kann so ziemlich alles was Monit auch kann.
Wie wäre es mit
Condition: failed ping 3 cycles
im Service Test und die Aktion (in unserem Beispiel 'Restart') wird erst beim 3. Fehler ausgeführt.

Quote from: noname12123 on June 25, 2018, 02:52:18 PM
P.S Übrigens wäre ein Widget sehr wertvoll für ein Monitor Tool.

Ja, daran habe ich schon gedacht. Nur ist es vom Design her schwierig alle Services in einem kleinen Widget abzubilden.

#28
Du musst für den Ping Test die Aktion 'Restart' definieren.
Dann kannst Du im Service für 'Start' und 'Stop' die entsprechenden
Befehle verwenden.
Ich schätze aber, dass Du mit dem /etc/rc.d/netif nicht weit kommst,
da OPNsense eine eigene Logik hat die Netzwerkkarten zu aktivieren.

Aber Du kannst mal das hier probieren:
1. via OPNsense configctl mit dem Alias (z.B. OPT2)
Start: configctl interface linkup start <ALIASNAME>
Stop: configctl interface linkup stop <ALIASNAME>

2. via ifconfig und dem Interfacenamen (z.B. igb2)
Start: /sbin/ifconfig <INTERFACE> up
Stop: /sbin/ifconfig <INTERFACE> down

Vielleicht wäre es aber sinnvoller herauszufinden warum sich das Interface aufhängt.
Gibt es da keine Log Einträge? Link up/down o.ä.?
Irgendwelche Erkenntnisse aus sysctl -a | grep igb.2 ?



#29
Müsste mit
/etc/rc.d/netif restart <DEVICE>
funktionieren.
Das <DEVICE> bekommst Du von "Interfaces->Assignments".

#30
Dein Service Test ist falsch.

Für einen simplen Ping Test brauchst Du
1. Service Test (müsste eigentlich mit der Installation des Plugins schon erstellt worden sein)
Name: Ping
Condition: failed ping
Action: Alert

2. Service
Name: ping123
Type: Remote Host
Address: 192.168.2.2
Tests: Ping