
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
github.com/ypsi-sas/plugin-zabbix-fe
First, clone the repo of Zabbix :
git clone https://git.zabbix.com/scm/zbx/zabbix.git --depth 1 zabbix-agent2
After, clone this repo :
git clone https://github.com/YPSI-SAS/plugin-zabbix-fe.git
Finally, copy the directory flexibleengine into the zabbix-agent2 directory:
cp -r plugin-zabbix-fe/flexibleengine zabbix-agent2/src/go/plugins/flexibleengine
And modify the three files in zabbix-agent2/src/go/plugins (plugins_linux.go, plugins_windows.go, plugins_darwin.go) by adding this line in import list:
_ "zabbix.com/plugins/flexibleengine"
First, go to the zabbix source
cd zabbix-agent2
Run this command to build the agent with the new plugin:
./bootstrap.sh; ./configure --enable-agent2 --enable-static; make
If you are errors, try to install differents packages:
sudo apt install automake autoconf pcre* -y
sudo apt-get install libpcre3-dev
You can try the Zabbix binary generate in zabbix-agent2/src/go/bin KEY correspond to a key value defined in method Export in flexibleengine/flexibleEngine.go param1 correspond to the first parameter for plugin
<zabbix-source>/src/go/bin/zabbix_agent2 -t KEY[param1]
Example, change all parameters with your own:
<zabbix-source>/src/go/bin/zabbix_agent2 -t flexibleengine.ecs.cpu[ACCESS_KEY,SECRET_KEY,PROJECT_ID,INSTANCE_ID,REGION,FRAME,PERIOD,FILTER]
If the zabbix-agent2 isn't already running use this commands. On CentOS7, the Zabbix Agent2 is not installed.
First, create the service systemd to run agent2 in daemon.
nano /etc/systemd/system/zabbix-agent2.service
Write this information in the file:
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agent2.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent2
Type=simple
Restart=on-failure
PIDFile=/run/zabbix/zabbix_agent2.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_agent2 -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
Next, copy the file zabbix_agent2.conf in the direcroty /etc/zabbix.
cp <zabbix-source>/src/go/conf/zabbix_agent2.conf /etc/zabbix/
Finally, add the binary zabbix_agent2 in the directory /usr/sbin
cp <zabbix-source>/src/go/bin/zabbix_agent2 /usr/sbin/
You can't run the both agents in the same time because they listen on the same port. To keep the both agents running, change the listen port for one agent in his confid file in /etc/zabbix.
Modify the parameter ListenPort, remove the # in the beginning of the line and restart the agent.
After that, the both agents must be functional and the plugin flexibleengine are accessible in Zabbix.
If the zabbix-agent2 is already running make this three commands to modify agent2:
systemctl stop zabbix-agent2
cp <zabbix-source>/src/go/bin/zabbix_agent2 /usr/sbin/
systemctl start zabbix-agent2
I describe the procedure for the NAT template but is the same procedure for other element. First, go to your Zabbix application in Configuration > Templates. Choose the button import in upper right of your screen. Select a template Cloud-FlexibleEngine-NAT.xml file in the templates directory.
After, you must change MACROS values in the template for this go to MACROS menu and set your value for {$ACCESS_KEY}, {$PROJECT_ID}, {$SECRET_KEY}. At this, moment don't set the {$INSTANCE_ID} value.
Once your template created, you can create a new host in Configuration > Hosts. In Templates menu choose Cloud-FlexibleEngine-NAT template and in Macros menu, go to Inherited and host macros and modify the value for {$INSTANCE_ID} with your NAT ID.
For template EVS, you must define {$INSTANCE_ID} value which is the ID of the EVS and define {$DISK_NAME} which is the ID of the ECS with the of disk device after like this: 93503d16-53a0-41ec-985f-ae6eee18a3b6-vda
For template DDS, you must define {$INSTANCE_ID} value which is the ID of the DDS and define {$ROLE} which is the role of the DDS (primary or secondary)
For template DCS, you must define {$INSTANCE_ID} value which is the ID of the DCS and define {$ENGINE} which is the engine of the DCS For template OBS, you must define {$BUCKET_NAME} value which is the name of the OBS
To begin, create a host group which has the domain name in FE.
Import the template "Cloud-FlexibleEngine-Discovery" and all templates of object you want.
After, create one host by project. For this, create host and give a name.
Add this host to the host group created previously.
Link the template "Cloud-FlexibleEngine-Discovery" to this host.
Add agent interface.
In tags section, define two tags. The first is to define the name of a project (name: project ; value: NAME_OF_YOUR_PROJECT). The second is to define the region of a projet (name: region ; value: NAME_OF_YOUR_REGION).
Finally, in macros section, you must define values of each inherited macros :
To use discovery plugin, it's necessary to increase the Timeout number in the configuration files of server and agent2. The files are located in /etc/zabbix. Modify the Timeout parameter with value 30 in both files.
Timeout=30
Finally, restart both services:
systemctl restart zabbix-server.service
systemctl restart rabbix-agent2.service
If you don't make this change, your discovery item will get this error : Timeout occurred while gathering data
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.