plugin_mikrotik
plugin_mikrotik copied to clipboard
No Graph Generated with good install
Describe the bug A clear and concise description of what the bug is. Hello, I'm opening the ticket for you because I have a problem with the Mikrotik plugin.
I did the 'import_package.php but the system does not create a graph although it retrieves the data well. I checked the rights of the files and folders they are all good (it seems to me) I do not see what to look for. There were no errors during installation.
To Reproduce Steps to reproduce the behavior:
- Go to 'cli' via putty
- php /opt/cacti/cli/import_package.php --filename=/opt/cacti/plugins/mikrotik/templates/MikroTik_Device.xml.gz
- add graph with device
- Graph is empty
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Plugin (please complete the following information):
- Version: [e.g. 1.2]
- Source: [github]
- Identifer: [github commit ref]
Desktop (please complete the following information):
- OS: all
- Browser all
- Version all
Additional context Add any other context about the problem here. root@cacti:~# php /opt/cacti/cli/import_package.php --filename=/opt/cacti/plugin s/mikrotik/templates/MikroTik_Device.xml.gz Read 131417 bytes of Package data Résultat de l'importation Cacti has imported the following items for the Package : Package Files /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_snmpget.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_count_oids.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_cpu.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_procs.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_mem.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_disk.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_users.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_uptime.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_health.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_wapcount.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_wrcount.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_trees.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_qcount.php [written] /opt/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_wireless_r eg.xml [written] /opt/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_queues.xml [written] /opt/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_trees.xml [written] /opt/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_qusers.xml [written] /opt/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_interfaces .xml [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_wireless_reg.php [writ ten] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_queues.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_qtrees.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_qusers.php [written] /opt/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_interfaces.php [writte n] CDEF [succès] Turn Bytes into Bits [unchanged] [succès] Turn Seconds into Hours [nouveau] [succès] Make Per 5 Minutes [unchanged] GPRINT Preset [succès] Normal [unchanged] [succès] Exact Numbers [unchanged] [succès] Percentage as Decimal [nouveau] Méthode d'acquisition des données [succès] MikroTik - Device - SNMP Get [nouveau] [succès] MikroTik - Device - Count Oids [nouveau] [succès] MikroTik - Device - CPU Utilization [nouveau] [succès] MikroTik - Device - Processes [nouveau] [succès] MikroTik - Device - Memory Utilization [nouveau] [succès] MikroTik - Device - Disk Utilization [nouveau] [succès] MikroTik - Device - Users [nouveau] [succès] MikroTik - Device - Uptime [nouveau] [succès] MikroTik - Device - Health [nouveau] [succès] MikroTik - Device - Wireless APs [nouveau] [succès] MikroTik - Device - Wireless Reg [nouveau] [succès] MikroTik - Device - Trees [nouveau] [succès] MikroTik - Device - Queues [nouveau] Modèle de données [succès] MikroTik - Device - PPP Active [nouveau] [succès] MikroTik - Device - IP Routes [nouveau] [succès] MikroTik - Device - Wireless Connections [nouveau] [succès] MikroTik - Device - IP/ARP Entries [nouveau] [succès] MikroTik - Device - CPU Utilization [nouveau] [succès] MikroTik - Device - Processes [nouveau] [succès] MikroTik - Device - Memory Utilization [nouveau] [succès] MikroTik - Device - Disk Utilization [nouveau] [succès] MikroTik - Device - Users [nouveau] [succès] MikroTik - Device - Uptime [nouveau] [succès] MikroTik - Device - Health - 12.0 Voltage [nouveau] [succès] MikroTik - Device - Health - 5.0 Voltage [nouveau] [succès] MikroTik - Device - Health - 3.3 Voltage [nouveau] [succès] MikroTik - Device - Health - Core Voltage [nouveau] [succès] MikroTik - Device - Health - Voltage [nouveau] [succès] MikroTik - Device - Health - CPU Temperature [nouveau] [succès] MikroTik - Device - Health - Processor Temperature [nouveau] [succès] MikroTik - Device - Health - Sensor Temperature [nouveau] [succès] MikroTik - Device - Health - Temperature [nouveau] [succès] MikroTik - Device - Health - Power [nouveau] [succès] MikroTik - Device - Health - Current [nouveau] [succès] MikroTik - Device - Wireless APs [nouveau] [succès] MikroTik - Device - Wireless Reg [nouveau] [succès] MikroTik - Device - Trees [nouveau] [succès] MikroTik - Device - Queues [nouveau] [succès] MikroTik - DHCP - Leases [nouveau] [succès] MikroTik - Wireless Reg - Data Rates [nouveau] [succès] MikroTik - Wireless Reg - Packets [nouveau] [succès] MikroTik - Wireless Reg - Traffic [nouveau] [succès] MikroTik - Wireless Reg - Uptime [nouveau] [succès] MikroTik - Queue - Packets [nouveau] [succès] MikroTik - Queue - Traffic [nouveau] [succès] MikroTik - Queue - Queues/Drops [nouveau] [succès] MikroTik - Trees - Packets [nouveau] [succès] MikroTik - Trees - Bytes [nouveau] [succès] MikroTik - Users - Total Packets In/Out [nouveau] [succès] MikroTik - Users - Current Packets In/Out [nouveau] [succès] MikroTik - Users - Total Bytes In/Out [nouveau] [succès] MikroTik - Users - Current Bytes In/Out [nouveau] [succès] MikroTik - Users - Connect Time [nouveau] [succès] MikroTik - Interfaces - Bytes Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Packets Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Rx Distribution [nouveau] [succès] MikroTik - Interfaces - Special Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Tx Distribution [nouveau] [succès] MikroTik - Interfaces - Tx Errors [nouveau] [succès] MikroTik - Interfaces - Rx Errors [nouveau] Modèle de graphique [succès] MikroTik - Device - PPP Active [nouveau] [succès] MikroTik - Device - IP Routes [nouveau] [succès] MikroTik - Device - Wireless Connections [nouveau] [succès] MikroTik - Device - IP/ARP Entries [nouveau] [succès] MikroTik - Device - CPU Utilization [nouveau] [succès] MikroTik - Device - Processes [nouveau] [succès] MikroTik - Device - Memory Utilization [nouveau] [succès] MikroTik - Device - Disk Utilization [nouveau] [succès] MikroTik - Device - Users [nouveau] [succès] MikroTik - Device - Uptime [nouveau] [succès] MikroTik - Device - Health - 12.0 Voltage [nouveau] [succès] MikroTik - Device - Health - 5.0 Voltage [nouveau] [succès] MikroTik - Device - Health - 3.3 Voltage [nouveau] [succès] MikroTik - Device - Health - Core Voltage [nouveau] [succès] MikroTik - Device - Health - Voltage [nouveau] [succès] MikroTik - Device - Health - CPU Temperature [nouveau] [succès] MikroTik - Device - Health - Processor Temperature [nouveau] [succès] MikroTik - Device - Health - Sensor Temperature [nouveau] [succès] MikroTik - Device - Health - Temperature [nouveau] [succès] MikroTik - Device - Health - Power [nouveau] [succès] MikroTik - Device - Health - Current [nouveau] [succès] MikroTik - Device - Wireless APs [nouveau] [succès] MikroTik - Device - Wireless Regs [nouveau] [succès] MikroTik - Device - Trees [nouveau] [succès] MikroTik - Device - Queues [nouveau] [succès] MikroTik - DHCP - Leases [nouveau] [succès] MikroTik - Wireless Reg - Data Rates [nouveau] [succès] MikroTik - Wireless Reg - Packets [nouveau] [succès] MikroTik - Wireless Reg - Traffic (bytes/sec) [nouveau] [succès] MikroTik - Wireless Reg - Traffic (bits/sec) [nouveau] [succès] MikroTik - Wireless Reg - Uptime [nouveau] [succès] MikroTik - Queues - Packets In/Out [nouveau] [succès] MikroTik - Queues - Traffic (bytes/sec) [nouveau] [succès] MikroTik - Queues - Traffic (bits/sec) [nouveau] [succès] MikroTik - Queues - Drops [nouveau] [succès] MikroTik - Queues - Queues In/Out [nouveau] [succès] MikroTik - Trees - Packets Total [nouveau] [succès] MikroTik - Trees - Traffic (bits/sec) [nouveau] [succès] MikroTik - Users - Total Packets In/Out [nouveau] [succès] MikroTik - Users - Current Packets In/Out [nouveau] [succès] MikroTik - Users - Total Bytes In/Out [nouveau] [succès] MikroTik - Users - Current Bytes In/Out [nouveau] [succès] MikroTik - Users - Connect Time [nouveau] [succès] MikroTik - Interfaces - Bytes Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Packets Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Rx Distribution [nouveau] [succès] MikroTik - Interfaces - Special Tx/Rx [nouveau] [succès] MikroTik - Interfaces - Tx Distribution [nouveau] [succès] MikroTik - Interfaces - Tx Errors [nouveau] [succès] MikroTik - Interfaces - Rx Errors [nouveau] Interrogation avancée [succès] MikroTik - Wireless Reg [nouveau] [succès] MikroTik - Queues [nouveau] [succès] MikroTik - Trees [nouveau] [succès] MikroTik - Users [nouveau] [succès] MikroTik - Interfaces [nouveau] Modèle d'équipement [succès] MikroTik Device [nouveau]
Data ok
But the graph is empty or not generated (only cpu usage is generated):
07/04/2022 13:55:08 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/mikrotik/poller_mikrotik.php[136]:getLatestVersion(), /plugins/mikrotik/poller_mikrotik.php[146]:file_get_contents(), CactiErrorHandler())
07/04/2022 13:55:08 - ERROR PHP WARNING in Plugin 'mikrotik': file_get_contents(http://upgrade.mikrotik.com/routeros/LATEST.6): failed to open stream: Connection timed out in file: /opt/cacti/plugins/mikrotik/poller_mikrotik.php on line: 146
You likely don't have access to the internet, or they changed the link. Let me check.
That's the issue. I guess that we may need to add an option to suppress the message, or add a proxy. We added proxy support in Cacti 1.3, but that project is still stalled.
I think the problem is that the code must access the Mikrotik site (http://upgrade.mikrotik.com/routeros/LATEST.6).
Do you think this is the problem why mikrotik plugins dont generate the graph ?
I can check the cacti can join the mikrotik site now.
I just did a test with wget to check if cacti can access the link and it works. I erased the faulty graphs and I regenerated them but the problem persists. I look at the logs in debug I do not see anything in error..
Under your user profile, you should select to show graph names, then we can see what Graphs are broken.
all these graphs don't work:
The others work well like the queue and SNMP - Interface Statistics for example
For information :
mine on the interface always 0 rows even though i can see that it was able to pull data from snmp
i just found that in /cacti/data_input.php the mikrotik scripts have not input or output field. Do think this is the problem ? if yes how do repair this ?
I used this command for install the template :
php /opt/cacti/cli/import_package.php --filename=/opt/cacti/plugins/mikrotik/templates/MikroTik_Device.xml.gz
I think the basic howto should be updated and mentioned that the plugin after installed should be activated and last but not the least after adding device make sure that you have read only users via mikrotik api and this plugins will start to work beautifully
API is OK :
Install plugins is OK :
Install template with cli is OK
But the data input method is incomplete and the cacti not create graph ...
I tried to reinstall, nothing ..
for information
I don't know what else to add in this ticket in order to be able to give you information to be able to help me or to be able to solve this bug. What additional information would be needed?
Graph Title Shown Below:
Edit your User Profile and Toggle the Show Graph Title
Sorry busy you know.
Didn't work :
And didn't work MikroTik - Interfaces, MikroTik - Users
But work well the MikroTik - Trees :
ok I understand let me know when you have time to test the plugin ;)
hello I come to the news for that. Did you work on it?
Hi, Also having the same issue of graphs not showing when using Mikrotik template, the interface gives error, and for some reason the Mikrotik plugging drop the mysql server and regain access to cacti after disabling the mikrotik pluging
Edit:
This is error i get when activating the Mikrotik Plugin 2022-06-06 10:12:01 - PLUGIN WARNING: Function does not exist config_form with function mikrotik_config_form
hello do you recommend deactivating the plugin for it to work or do you think an update is necessary?
Bellow is debug log for the Mikrotik Interface as not of them are able to retrieve data, But when using the Cisco ROuter template i can see interface information
{
Total: 0.000000, Delta: 0.000000, Found data query XML file at '/usr/share/cacti/plugins/mikrotik/templates/resource/script_server/mikrotik_interfaces.xml'
Total: 0.010000, Delta: 0.010000, Running Data Query [26]. Total: 0.010000, Delta: 0.000000, Found Type = '6' [Script Server Query]. Total: 0.010000, Delta: 0.000000, XML file parsed ok. Total: 0.080000, Delta: 0.070000, Data Query returned no indexes. Total: 0.080000, Delta: 0.000000, <arg_num_indexes> exists in XML file but no data returned., 'Index Count Changed' not supported Total: 0.080000, Delta: 0.000000, Executing script for num of indexes '"/usr/bin/php" -q /usr/share/cacti/plugins/mikrotik/templates/scripts/ss_mikrotik_interfaces.php '124' 'num_indexes'' Total: 0.140000, Delta: 0.060000, ERROR: Data Query returned no indexes.
}