jmpep / IPsubnet

IP subnet calculator IPv4 IPv6 HTML5 css bootstrap
MIT License
14 stars 4 forks source link

Not install on Cacti 1.0.0 #1

Open pautiina opened 7 years ago

pautiina commented 7 years ago

Cacti plugin manager write that: Not Compatible I Change setup.php and add file INFO. After this I install plugin, but have html and jquery error. Help fix and prepare the plug-in to the new version Cacti. I have make some change. Now plugin install and work? but i think that I have some mistake. Please repear me. ipsubnet.zip

pautiina commented 7 years ago

For new architecture plugin need change setup.php file. Now all information about plugin must locate on INFO file. INFO.zip

jmpep commented 7 years ago

update on going. I have now a cacti 1.0.1 for test. bootstrap seams not compatible. But ipsubnet.html (outside cacti) should function also with bootstrap. therefore I am rewritting some bootsrap css and jquery. As Workaround start it like http(s)://.../cacti/ipsubnet/ipsubnet.html or change the cacti theme to something else as 'classic'.

pautiina commented 7 years ago

OK, if I can help you told me please. I will test and write results if you do not mind.

jmpep commented 7 years ago

Now a update for IPsubnet Cacti 1.x.x plugin ' IPsubnet-cacti-v1.0.1-plugin.zip'. Could you test ? The themes are now the sames. I will do the changes later. You could also try to change the Color of the themes. PS: I will also correct later the visualisation of this plugin in Cacti 0.8.8x. Thanks for the feedback and the tests. Jean-Michel

pautiina commented 7 years ago

OK, i have test. When I Install plugin I have error on Cacti log:

2017-02-13 09:37:20 - ERROR PHP NOTICE in  Plugin 'ipsubnet': Undefined index: Utilities in file: /var/www/cacti/plugins/ipsubnet/setup.php  on line: 186
2017-02-13 09:37:20 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php: 25 include)(/include/auth.php: 27 include)(/include/global.php: 318 include_once)(/include/global_arrays.php: 1485 api_plugin_hook)(/lib/plugins.php: 68 api_plugin_run_plugin_hook)(/lib/plugins.php: 161 ipsubnet_config_arrays)(/plugins/ipsubnet/setup.php: 186 CactiErrorHandler)(/lib/functions.php: 4242 cacti_debug_backtrace)

To resolve thits i remove and change some line on file setup.php. I remove:

   $temp = $menu["Utilities"]['logout.php'];
   unset($menu["Utilities"]['logout.php']);
   $menu["Utilities"]['logout.php'] = $temp;

I change: $menu["Utilities"]['plugins/ipsubnet/ipsubnet-console.php'] = "IP subnet calculator"; to: $menu[__('Utilities')]['plugins/ipsubnet/ipsubnet-console.php'] = __('IP subnet calculator'); Patch for this error: ipsubnet_patch.zip After thiis patch plugin install without error.

pautiina commented 7 years ago

When I open browser console for usl https://noc/cacti/plugins/ipsubnet/ipsubnet.php have this erro:

Navigated to https://noc/cacti/plugins/ipsubnet/ipsubnet.php
https://noc/cacti/plugins/ipsubnet/images/WORLD-flg.png 404 (Not Found) ipsubnet.php:113 GET
https://noc/cacti/plugins/ipsubnet/images/WORLD-flg.png 404 (Not Found) WORLD-flg.png:1 GET
https://noc/cacti/plugins/ipsubnet/images/WORLD-flg.png 404 (Not Found) WORLD-flg.png:1 GET

on this URL with this error plugin works.

But when I open this url https://noc/cacti/plugins/ipsubnet/ipsubnet-console.php plugin have many error and dont work

infoIPv4v6-EN.html Failed to load resource: the server responded with a status of 404 (Not Found)
https://noc/cacti/lang/infoIPv4v6-EN.html#iframeinfoIPfield Failed to load resource: the server responded with a status of 404 (Not Found)
WORLD-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
UK-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
FR-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
IT-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
US-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
DE-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
ZH-HANS-flg.png Failed to load resource: the server responded with a status of 404 (Not Found)
infoIPv4v6-EN.html Failed to load resource: the server responded with a status of 404 (Not Found)
https://noc/cacti/lang/infoIPv4v6-EN.html#iframeinfoIPfield Failed to load resource: the server responded with a status of 404 (Not Found)
Navigated to https://noc/cacti/plugins/ipsubnet/ipsubnet-console.php
ipsubnet-console.php:96 GET https://noc/cacti/plugins/ipsubnet/images/WORLD-flg.png 404 (Not Found)
WORLD-flg.png:1 GET https://noc/cacti/plugins/ipsubnet/images/WORLD-flg.png 404 (Not Found)
Navigated to https://noc/cacti/index.php
jquery.js:5891 GET https://noc.cacti/lang/infoIPv4v6-EN.html 404 (Not Found)
(anonymous) @ jquery.js:5891
access @ jquery.js:3914
html @ jquery.js:5869
(anonymous) @ layout.js:554
fire @ jquery.js:3243
fireWith @ jquery.js:3373
done @ jquery.js:9098
(anonymous) @ jquery.js:9340
jquery.js:5891 GET https://noc/cacti/lang/infoIPv4v6-EN.html 404 (Not Found)
(anonymous) @ jquery.js:5891
access @ jquery.js:3914
html @ jquery.js:5869
(anonymous) @ layout.js:554
fire @ jquery.js:3243
fireWith @ jquery.js:3373
done @ jquery.js:9098
(anonymous) @ jquery.js:9340
WORLD-flg.png:1 GET https://noc/cacti/images/WORLD-flg.png 404 (Not Found)
UK-flg.png:1 GET https://noc/cacti/images/UK-flg.png 404 (Not Found)
IT-flg.png:1 GET https://noc/cacti/images/IT-flg.png 404 (Not Found)
FR-flg.png:1 GET https://noc/cacti/images/FR-flg.png 404 (Not Found)
US-flg.png:1 GET https://noc/cacti/images/US-flg.png 404 (Not Found)
DE-flg.png:1 GET https://noc/cacti/images/DE-flg.png 404 (Not Found)
ZH-HANS-flg.png:1 GET https://noc/cacti/images/ZH-HANS-flg.png 404 (Not Found)
jmpep commented 7 years ago

1/ "https://noc/cacti/images/.... 404 " I think you didn't copy all files and folders' structures of IPsubnet-cacti-v1.0.1-plugin.zip also don't forget to change the owner rights. 'chown -R user:group ....../ipsubnet/* 2/ for $menu[utilities] should be ok, but I will check this night. Which language do you use?

pautiina commented 7 years ago
  1. Files and folders I copy, but I have FreeBSD. Large and small letters are irrelevant. Listing of folder images:
    -rw-r--r--   1 www   www      179 13 февр. 01:07 DE-flg.png
    -rw-r--r--   1 www   www      177 13 февр. 01:07 FR-flg.png
    -rw-r--r--   1 www   www      760 13 февр. 01:07 help.gif
    -rw-r--r--   1 www   www      177 13 февр. 01:07 IT-flg.png
    -rw-r--r--   1 www   www     1567 13 февр. 01:07 tab_ipsubnet-green.gif
    -rw-r--r--   1 www   www     9114 13 февр. 01:07 tab_ipsubnet-green.psd
    -rw-r--r--   1 www   www     1513 13 февр. 01:07 tab_ipsubnet.gif
    -rw-r--r--   1 www   www     9114 13 февр. 01:07 tab_ipsubnet.psd
    -rw-r--r--   1 www   www     1048 13 февр. 01:07 UK-flg.png
    -rw-r--r--   1 www   www    17178  3 янв.  21:21 UK.png
    -rw-r--r--   1 www   www      484 13 февр. 01:07 US-flg.png
    -rw-r--r--   1 www   www     2766 13 февр. 01:07 world-flg.png
    -rw-r--r--   1 www   www      280 13 февр. 01:07 ZH-HANS-flg.png

    Of course, I can use mod_speling for Apache, but i think it's nor right for Unix users

  2. I use russian
jmpep commented 7 years ago

I have uploaded new release:

Do you have the same behaviour ? clicking TAB OK, Through menu css files not loaded (wrong path).

pautiina commented 7 years ago

I also have ame behaviour. When I refresh page all OK. Before refreshing the page I have error on Browser console:

GET https://noc/cacti/lang/infoIPv4v6-EN.html 404 (Not Found)
(anonymous) @ jquery.js:5891
access @ jquery.js:3914
html @ jquery.js:5869
(anonymous) @ layout.js:554
fire @ jquery.js:3243
fireWith @ jquery.js:3373
done @ jquery.js:9098
(anonymous) @ jquery.js:9340
jquery.js:5891 GET https://noc/cacti/lang/infoIPv4v6-EN.html 404 (Not Found)
(anonymous) @ jquery.js:5891
access @ jquery.js:3914
html @ jquery.js:5869
(anonymous) @ layout.js:554
fire @ jquery.js:3243
fireWith @ jquery.js:3373
done @ jquery.js:9098
(anonymous) @ jquery.js:9340
WORLD-flg.png:1 GET https://noc/cacti/images/WORLD-flg.png 404 (Not Found)
UK-flg.png:1 GET https://noc/cacti/images/UK-flg.png 404 (Not Found)
FR-flg.png:1 GET https://noc/cacti/images/FR-flg.png 404 (Not Found)
IT-flg.png:1 GET https://noc/cacti/images/IT-flg.png 404 (Not Found)
US-flg.png:1 GET https://noc/cacti/images/US-flg.png 404 (Not Found)
DE-flg.png:1 GET https://noc/cacti/images/DE-flg.png 404 (Not Found)
ZH-HANS-flg.png:1 GET https://noc/cacti/images/ZH-HANS-flg.png 404 (Not Found)

Also i move file world-flg.png to WORLD-flg.png, now this images load and no error in TAB load.

jmpep commented 7 years ago

Hi corrected in IPsubnet-cacti-v1.0.1-plugin.zip / IPsubnet-cacti-plugin.zip added/corrected themes added RU (Google Russian) I hope not too bad. (themes change automaticallly at the same time as Cacti, the language not automatically I search why, but the session language is memorized) P: Can you check on your Environment ? and give me some feedback about the Google-russian. thanks

pautiina commented 7 years ago

Hello, today I retest and write feedback

pautiina commented 7 years ago

OK, I test plugin and have some results. Now plugin wirk on Cacti Console and Cacti Tab, its good. On HTML Console have one error:

Uncaught ReferenceError: ru is not defined
    at ipsubnet.php:66

Google has translated slightly wrong. I created a patch with fixes for Russian language: ipsubnet-patch.zip Chechkboks not removed from the previous value: ipsubnet

jmpep commented 7 years ago

RU updated (thanks) radio button corrected error-message 'ru' corrected.

pautiina commented 7 years ago

Hello. I have retest plugin and have new results. Now HTML console have only one error, when I change Language to Default:

GET https://noc/cacti/plugins/ipsubnet/lang/infoIPv4v6-WORLD.html 404 (Not Found)
attr @ jquery.js:7384
access @ jquery.js:3928
attr @ jquery.js:7341
setlanguageObjects @ ipsubnet.js:2469
changelanguage @ ipsubnet.js:2482
onclick @ ipsubnet.php:120

All previous bug fixes, everything works and everything is very beautiful. Thank you. After correction of the last error I think the issues can be closed and the plugin a full ready for installation and use in the new version of Cacti. Now my Cacti verion 1.0.3.

jmpep commented 7 years ago

correction uploaded ( js/ipsubnet.js, setup.php )

pautiina commented 7 years ago

Hello, I have retest. I use clean setup plugin. With clean setup I have some error on HTML console: WORLD-flg.png Failed to load resource: the server responded with a status of 404 (Not Found) After renaming images/world-flg.png file to images/WORLD-flg.png - error away. When I choose subnet from history, many fields are wrong: 19

jmpep commented 7 years ago

correction uploaded thanks for the support

pautiina commented 7 years ago

Hello. Thanks for good work. I have retest plugin and find new error. When I select the bottom of the Ipv6 Reserved and then select subnet from history HTML console have error: 20

jmpep commented 7 years ago

hello a new version v1.0.9. I hope all is corrected. thanks

pautiina commented 7 years ago

Hello. I have retest plugin. On Cacti.log I have DEBUG message: 2017-03-06 09:49:51 PLUGIN IPSUBNET: DEBUG Manual: ipsubnet_config_arrays cacti_version=1.0.5 I think you forgot to just comment out these lines on setup.php. This message is repeated every time one starts poller.php and the log file grows. I also found a problem when choosing network from the history: I must choose a twice net to plugin switched on it.

jmpep commented 7 years ago

for the debug in setup.php line 188 comment with // or remove these following lines. I will remove these line from Github soon, //DEBUG $message =""; $message= $message . "PLUGIN IPSUBNET: DEBUG Manual: ipsubnet_config_arrays cacti_version=".$version."\n"; ipsubnet_log($message,"1"); //ENDDEBUG

for the history I will check and I think replace the html-select in an other way.

pautiina commented 7 years ago

Ok, thanks. I will be wayt for new version

jmpep commented 7 years ago

new version (adding also stars (favorite) on history) enjoy

pautiina commented 7 years ago

Hello. I have retesed new version plugin. Nice work. But I have some problem with history. I choose a subnet and it is correctly calculated and all fields are substituted correctly except for the history: 24 And network not the first time the was added to the history, although it's probably my browser cache-but I'm not sure, it's need checking. Everything else works very well. Thank you.

jmpep commented 7 years ago

hi I upload a new version v1.0.12 correcting some issue with some browsers and issues for the initialisation. could you please install it? thanks

pautiina commented 7 years ago

Hello. I have retest new version. Problem with choose network from history is last. 26 Need twice choose network from history that to make everything right. I'll try to show what I'm doing.

  1. I want select network 192.168.0.0/22 from history - I have wrong results: 27
  2. I click to this network 192.168.0.0/22 on history second time: 28 After second click all right. And browser now not have error on console, problem with Jquery fix. Thanks.