Ad Widget

Collapse

Create a graph of data from a script that gets ran every minute

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IntriguedGuest
    Junior Member
    • Jul 2024
    • 1

    #1

    Create a graph of data from a script that gets ran every minute

    Good afternoon, morning, or evening to y'all!!

    I am very, VERY, green when it comes to using Zabbix. I have been working with a company who uses it for monitoring & I want to get more used to it so I can help them further.

    One of the things I'd like to do is to take the information out of a csv that gets re-written from a PowerShell script that I have set to run every minute in Task Scheduler, and display that as a graph with multiple points.

    Example of the csv output :

    "Service", "MemoryUsageMB"
    "Example1","142.82"
    ...
    "Example10","2628.52"


    So on and so on. Services shouldn't get removed, only added

    Trying to look at different forums & different posts here, but its just hard to piece things together, and was wondering if anyone could push me in the right direction! I see how specific Zabbix could be if used by someone who knows there stuff, so I don't think this is impossible.

  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    take the information out of a csv that gets re-written from a PowerShell script that I have set to run every minute in Task Scheduler, and display that as a graph with multiple points
    I'd consider using Zabbix trapper items:
    - create a host for this (or use an existing host)
    - in the host, create those Example1 ... Example10 items as Zabbix trapper items
    - in the PowerShell script, instead of writing the data in CSV file, use zabbix_sender to send the data to the items
    - in the host, create graphs from the items as you need.

    Instead of calling zabbix_sender you can also use some Zabbix sender PowerShell library (if exists) to do the same, or since Zabbix 7.0 you can also use Zabbix API (history.push) for it.

    Markku

    Comment


    • IntriguedGuest
      IntriguedGuest commented
      Editing a comment
      Thought so. Will take a look at Zabbix trapper items and see how to actually utilize that! When you say use zabbix_sender instead of writing to a csv, are you talking about inside of my powershell script? I was under the impression that zabbix sender was only Python.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #3
    Other thing is that you could maybe also use Zabbix agent items, either via UserParameters or system.run[] items to gather the Example1..10 data as Zabbix agent (or Zabbix agent active) items, without the scheduled tasks on Windows.

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #4
      When you say use zabbix_sender instead of writing to a csv, are you talking about inside of my powershell script? I was under the impression that zabbix sender was only Python.
      (Sorry for the delay, the forum does not show new comments very clearly)

      Yes, inside the script. See man page for zabbix_sender: https://www.zabbix.com/documentation.../zabbix_sender

      There is a Python library, but also something (non-official) for other languages as well, like https://www.powershellgallery.com/pa...ZabbixTrap.ps1 (don't know if it works). But you can obviously call zabbix_sender from the PowerShell script as well. I believe it is installed with the Zabbix agent on Windows.

      Markku

      Comment

      Working...