A secure web-based interface for importing Zabbix modules packaged as .tar.gz or .tgz archives.
- 🔒 Secure Upload - Multiple layers of validation and security checks
- 👤 Super Admin Only - Restricted access for maximum security
- ✅ Format Validation - Validates file extensions, MIME types, and structure
- 📦 Auto Extract - Automatically extracts and installs modules
- 🎨 Theme Support - Compatible with Zabbix Dark and Blue themes
- 📊 Progress Tracking - Real-time upload progress indicator
- 🖱️ Drag & Drop - Modern file upload interface
- 📋 Module Management - View installed modules
- Zabbix 7.0 or higher
- PHP 8.0 or higher
- Write permissions on
/usr/share/zabbix/modules/ - Write permissions on
/tmp/zabbix_module_import/
- Download the latest release:
wget https://github.com/Monzphere/importmodule/releases/latest/download/importmodule.tar.gz- Extract to Zabbix modules directory:
cd /usr/share/zabbix/modules/
tar -xzf importmodule.tar.gz- Set correct permissions:
chown -R www-data:www-data /usr/share/zabbix/modules/importmodule
chmod -R 755 /usr/share/zabbix/modules/importmodule- Enable the module in Zabbix:
- Navigate to Administration → General → Modules
- Click Scan directory
- Find Module Importer and click Enable
cd /usr/share/zabbix/modules/
git clone https://github.com/Monzphere/importmodule.git importmodule
chown -R www-data:www-data importmodule
chmod -R 755 importmoduleThen enable in Zabbix as described above.
- Log in to Zabbix as Super Admin
- Navigate to Administration → Import Module
- Upload your module package (
.tar.gzor.tgz)
- Click Choose File or drag and drop your module archive
- Validate the file meets requirements:
- Format:
.tar.gzor.tgz - Size: Maximum 50MB
- Contains valid
manifest.json
- Format:
- Click Upload and Import
- Wait for validation and extraction
- On success, enable the module in Administration → General → Modules
Your module package must contain:
module-name/
├── manifest.json (required)
├── Module.php (required)
├── actions/
│ └── CController*.php
├── views/
│ ├── *.php
│ └── js/
│ └── *.js.php
└── assets/
├── css/
│ └── *.css
└── js/
└── *.js
{
"manifest_version": 2.0,
"id": "my-module",
"name": "My Module",
"author": "Your Name",
"version": "1.0.0",
"namespace": "MyModule",
"description": "Module description",
"actions": {
"my.action": {
"class": "CControllerMyAction",
"view": "my.view"
}
},
"assets": {
"css": ["style.css"],
"js": ["script.js"]
}
}- File extension check (
.tar.gz,.tgzonly) - MIME type validation
- File size limit (50MB)
- Archive integrity check
- Required
manifest.jsonpresence - Valid JSON structure
- Required fields validation
- Module ID format validation
- Namespace format validation
- Duplicate module prevention
- Path traversal prevention
- Directory name sanitization
- Safe extraction to temporary directory
- Secure file permissions (755/644)
- Super Admin role required
- Permission checks on every action
- No anonymous access
Adjust these settings in php.ini if needed:
upload_max_filesize = 50M
post_max_size = 50M
max_execution_time = 300
memory_limit = 256MRestart PHP-FPM after changes:
systemctl restart php8.2-fpmEnsure these directories are writable:
chmod 755 /usr/share/zabbix/modules/
chmod 755 /tmp/zabbix_module_import/Check directory permissions:
ls -la /usr/share/zabbix/modules/
sudo chown -R www-data:www-data /usr/share/zabbix/modules/Verify the file is a valid gzipped tar archive:
file your-module.tar.gz
# Should output: gzip compressed dataThis usually means PharData couldn't read the archive. Check:
- File is not corrupted
- Archive contains a valid directory structure
- PHP has PharData support enabled
- Check module was uploaded:
ls -la /usr/share/zabbix/modules/- Verify manifest.json is valid:
cat /usr/share/zabbix/modules/your-module/manifest.json | python3 -m json.tool- Check Zabbix logs:
tail -f /var/log/zabbix/zabbix_server.logcd your-module/
tar -czf my-module.tar.gz --exclude='.git' --exclude='.gitignore' ./*- Create a test module package
- Upload via the interface
- Check module appears in Administration → General → Modules
- Enable and test functionality
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
See CHANGELOG.md for version history.
- Issues: GitHub Issues
- Documentation: Wiki
- Discussions: GitHub Discussions
- Zabbix Forum: Official Forum
- Built for Zabbix 7.0 module system
- Follows Zabbix module development guidelines
- Compatible with Zabbix coding standard
- Developed by MonZphere
If you discover a security vulnerability, please open a security advisory on GitHub or contact support@monzphere.com instead of using the public issue tracker.
Note: This module requires Super Admin privileges and should only be used in trusted environments. Always review module code before installation.