Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
I removed line 253 but received the following failure message:
Notice: Undefined variable: id2 in c:\Inetpub\wwwroot\cacti\plugins\configmanager\configmanager.php on line 254
Warning: Cannot modify header information - headers already sent by (output started at c:\Inetpub\wwwroot\cacti\plugins\configmanager\configmanager.php:254) in c:\Inetpub\wwwroot\cacti\plugins\configmanager\configmanager.php on line 269
I added line 253 again and as well I added the lines in 254. Based on the log I noticed that I could only save it, if all fields with "monthly, daily" are activated", otherwise I got the failure message (see in the log file).
After saving it (with all fields activated), I could see the list of devices, but it fails to add them into the config.
Likely the same issue with "non integer values" ?!?! Any idea?
kos wrote: I noticed that I could only save it, if all fields with "monthly, daily" are activated", otherwise I got the failure message (see in the log file).
OK I think we got it .... the false value in your PHP is not interpreted as 0 !!!
Can you try this ?
replace in configmanager.php the following lines (after line228)
$save["monthly"] = isset($_POST['chk_monthly']) ? (($_POST['chk_monthly']=="on")?1:0): 0;
/* info of Checkboxes are only set if "on" */
$save["mon"] = isset($_POST['chk_mon']) ? (($_POST['chk_mon']=="on")?1:0): 0;
$save["tue"] = isset($_POST['chk_tue']) ? (($_POST['chk_tue']=="on")?1:0): 0;
$save["wed"] = isset($_POST['chk_wed']) ? (($_POST['chk_wed']=="on")?1:0): 0;
$save["thu"] = isset($_POST['chk_thu']) ? (($_POST['chk_thu']=="on")?1:0): 0;
$save["fri"] = isset($_POST['chk_fri']) ? (($_POST['chk_fri']=="on")?1:0): 0;
$save["sat"] = isset($_POST['chk_sat']) ? (($_POST['chk_sat']=="on")?1:0): 0;
$save["sun"] = isset($_POST['chk_sun']) ? (($_POST['chk_sun']=="on")?1:0): 0;
If it works I will release this plugin into 0.5e.
I have also find an other bug for showing the pancho configuration when you click on the icon like a text in the view configmanager_edit (view for inserting the hosts)
In configmanager_edit.php the line 30
$message=date("d/m/Y H:i:s ")."SQL Save configuration's hosts in tables ".$cfgmngtable_data.". -> id result=$gid, code=".mysql_errno()
." errortext=".mysql_error()."\ndata to save are :".print_r($save,true)."\n";
cfgmng_log($message);
Same principle as before Each time you will do a insert/remove/move a hosts of the config your parameters and the SQL code will be inserted in the logfile of configmanager (either select Console/config updown-load/logfile or look at the file ...plugins/configmanager/cfgmng_logfile.txt)
what can you see ?
2/ What do you mind with 1)... the end of the url is not visible due to the size of the statusline of the explorer ?
You normally should see the view where you have to enter the hosts with a url like
$gid = sql_save2($save, $cfgmngtable_data);
$message=date("d/m/Y H:i:s ")."SQL Save configuration's hosts in tables ".$cfgmngtable_data.". -> id result=$gid, code=".mysql_errno()
." errortext=".mysql_error()."\ndata to save are :".print_r($save,true)."\n";
cfgmng_log($message);
if (!$gid) $failed = true;
You have also to remove the wrong datas from plugin_cfgmng_data ...
I see your configmanagerid => 2
1/ to see the data
delete from plugin_cfgmng_data where configmanagerid=2;
I say you have to remove the wrong data because I 've seen in your logfile:
[gorder] => 1
[state] => enable
.......
[hostid] => 20
[configmanagerid] => 2
[id] =>
(
data to save are :Array
22/01/2007 06:47:40 SQL Save configuration's hosts in tables plugin_cfgmng_data. -> id result=0, code=1054 errortext=Unknown column 'configid' in 'where clause'
)
kos wrote:
May be its again a problem with my php version [5.1.4]
May be this version PHP or SQL has some default to improve the control of the variable types. But it should function with any function. Therefore I have to do hardening too.
kos wrote:
Incorrect integer value: '' for column 'snmp_version'
I want to force the snmp_version field when not used ... do to 2 things
1/ in "configmanager_edit.php" replace line 224
if (isset($_POST['snmp_version'])) {$valuesnmp_version=$_POST['snmp_version'];} else {$valuesnmp_version=$snmp_versiondef;};
if (!is_int($valuesnmp_version)) $valuesnmp_version=1;
$valuesnmp_version=(($valuesnmp_version>0)&&($valuesnmp_version<4))?$valuesnmp_version:1;
but it functions now, doesn't it ? .... do you have problem to insert and remove hosts ?
I have posted the new release 0.5e with all the changes.
24.01.2007 hardening for some version of PHP and MySQL which are controlling more the variables types
in configmanager.php and configmanager_edit.php
19.01.2007 <?php in top_headertable.php
19.01.2007 some PHP version do not recognize the value false as 0. (configmanager.php)
16.01.2007 correction in version 0.5e showing the pancho configuration when you click on the icon like a text
in the view configmanager_edit (view for inserting the hosts