DEV Community

Rümeysa Öz for Açıklab

Posted on • Edited on

3 1 1

DHCP Logları Netex Sensöre Nasıl Yönlendirilir?

  • Logların toplanması gereken Windows makinesine NXLog'un en son sürümünü buradan indirip yükleyin.

  • Kurulumdan sonra, nxlog.conf dosyasını C:\Program Files\nxlog\conf klasöründe bulun.

Image description

  • Bir text file kullanarak nxlog.conf dosyasını açın. Windows sürümünüz için verilen metni kopyalayıp yapıştırarak Output syslogout satırının içindeki:
    • Host: Log gönderilmek istenen sensör'ün IP'si
    • Port: Log gönderilmek istenen sensör'ün port'u olacak şekilde değiştirin ve ardından dosyayı kaydedin.

Windows x64 bit OS:



define ROOT C:\Program Files\nxlog

Moduledir %ROOT%\modules
CacheDir  %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir  %ROOT%\data
LogFile %ROOT%\data\nxlog.log

<Input watchfile>
  Module im_file
  File 'C:\Windows\System32\dhcp\DhcpSrvLog-*.log'
  Exec $Message = $raw_event;
  Exec if file_name() =~ /.*\\(.*)/ $SourceName = $1;
  SavePos TRUE
  Recursive TRUE
</Input>

<Processor filewatcher_transformer>
  Module pm_transformer
  Exec $Hostname = hostname();
  OutputFormat json
</Processor>

<Output syslogout>
  Module om_tcp
  Host sensör_IP  
  Port 7785       
</Output> 

<Route 1>
  Path watchfile => filewatcher_transformer => syslogout
</Route>


Enter fullscreen mode Exit fullscreen mode
  • Config işlemini tamamladığımıza göre artık nxlog servisimizi restart ederek loglarımızı gönderebiliriz.

  • Control Panel > Services'e gidin ve nxlog service'ini bulun.

  • nxlog'a sağ tıklayın ve Restart'a tıklayın.

Image description

  • DHCP logları artık istenen sensöre yönlendirilir.

ÖRNEK

  • Logları göndermek istediğimiz sensör makinesinde şu komut çalıştırılır:


# tail -f /opt/netex-sensor/output.log


Enter fullscreen mode Exit fullscreen mode
  • DHCP içindeki makinelerden birinde ise şu komut çalıştırılır:


# systemctl restart NetworkManager


Enter fullscreen mode Exit fullscreen mode

ardından DHCP loglarının Netex sensöre yönlendirilmesi incelenebilir.

Image description

  • Liman MYS - Netex eklenti arayüzünde ise Discovery → Sensors sekmesinde ilgili sensörün solundaki ">" butonuna tıklanır ve sensöre ait ayrıntılar listelenir.

Image description

  • Ayrıntıların gözüktüğü ekranda sağdaki yenileme butonuna tıklanarak DHCP kaynağına son erişim tarihi buradan kontrol edililir.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay