Hi guys.
Custom scripts are something I use a lot in Zabbix UI (i.e. Administration/Scripts) to running remote command etc. on various servers. Currently, there appears to be a hard set limit of 255 characters per script/command, and I was hoping someone could advise on how I can increase this?
I have tried modifying the Zabbix database, "scripts" table as per below and changing the default "command" column from a "character varying(255)" type to say a "character varying(500)" type, but this doesn't seem to have made any difference.
Is there an easy way to do this?
Thanks in advance,
M
zabbix=# \d scripts;
Table "public.scripts"
Column | Type | Modifiers
--------------+------------------------+----------------------------------------
scriptid | bigint | not null
name | character varying(255) | not null default ''::character varying
command | character varying(255) | not null default ''::character varying
host_access | integer | not null default 2
usrgrpid | bigint |
groupid | bigint |
description | text | not null default ''::text
confirmation | character varying(255) | not null default ''::character varying
type | integer | not null default 0
execute_on | integer | not null default 1
Indexes:
"scripts_pkey" PRIMARY KEY, btree (scriptid)
"scripts_3" UNIQUE, btree (name)
"scripts_1" btree (usrgrpid)
"scripts_2" btree (groupid)
Foreign-key constraints:
"c_scripts_1" FOREIGN KEY (usrgrpid) REFERENCES usrgrp(usrgrpid)
"c_scripts_2" FOREIGN KEY (groupid) REFERENCES groups(groupid)
Referenced by:
TABLE "opcommand" CONSTRAINT "c_opcommand_2" FOREIGN KEY (scriptid) REFERENCES scripts(scriptid)
zabbix=# ALTER TABLE scripts ALTER COLUMN command TYPE character varying(500);
ALTER TABLE
zabbix=# \d scripts;
Table "public.scripts"
Column | Type | Modifiers
--------------+------------------------+----------------------------------------
scriptid | bigint | not null
name | character varying(255) | not null default ''::character varying
command | character varying(500) | not null default ''::character varying
host_access | integer | not null default 2
usrgrpid | bigint |
groupid | bigint |
description | text | not null default ''::text
confirmation | character varying(255) | not null default ''::character varying
type | integer | not null default 0
execute_on | integer | not null default 1
Indexes:
"scripts_pkey" PRIMARY KEY, btree (scriptid)
"scripts_3" UNIQUE, btree (name)
"scripts_1" btree (usrgrpid)
"scripts_2" btree (groupid)
Foreign-key constraints:
"c_scripts_1" FOREIGN KEY (usrgrpid) REFERENCES usrgrp(usrgrpid)
"c_scripts_2" FOREIGN KEY (groupid) REFERENCES groups(groupid)
Referenced by:
TABLE "opcommand" CONSTRAINT "c_opcommand_2" FOREIGN KEY (scriptid) REFERENCES scripts(scriptid)
Custom scripts are something I use a lot in Zabbix UI (i.e. Administration/Scripts) to running remote command etc. on various servers. Currently, there appears to be a hard set limit of 255 characters per script/command, and I was hoping someone could advise on how I can increase this?
I have tried modifying the Zabbix database, "scripts" table as per below and changing the default "command" column from a "character varying(255)" type to say a "character varying(500)" type, but this doesn't seem to have made any difference.
Is there an easy way to do this?
Thanks in advance,
M
zabbix=# \d scripts;
Table "public.scripts"
Column | Type | Modifiers
--------------+------------------------+----------------------------------------
scriptid | bigint | not null
name | character varying(255) | not null default ''::character varying
command | character varying(255) | not null default ''::character varying
host_access | integer | not null default 2
usrgrpid | bigint |
groupid | bigint |
description | text | not null default ''::text
confirmation | character varying(255) | not null default ''::character varying
type | integer | not null default 0
execute_on | integer | not null default 1
Indexes:
"scripts_pkey" PRIMARY KEY, btree (scriptid)
"scripts_3" UNIQUE, btree (name)
"scripts_1" btree (usrgrpid)
"scripts_2" btree (groupid)
Foreign-key constraints:
"c_scripts_1" FOREIGN KEY (usrgrpid) REFERENCES usrgrp(usrgrpid)
"c_scripts_2" FOREIGN KEY (groupid) REFERENCES groups(groupid)
Referenced by:
TABLE "opcommand" CONSTRAINT "c_opcommand_2" FOREIGN KEY (scriptid) REFERENCES scripts(scriptid)
zabbix=# ALTER TABLE scripts ALTER COLUMN command TYPE character varying(500);
ALTER TABLE
zabbix=# \d scripts;
Table "public.scripts"
Column | Type | Modifiers
--------------+------------------------+----------------------------------------
scriptid | bigint | not null
name | character varying(255) | not null default ''::character varying
command | character varying(500) | not null default ''::character varying
host_access | integer | not null default 2
usrgrpid | bigint |
groupid | bigint |
description | text | not null default ''::text
confirmation | character varying(255) | not null default ''::character varying
type | integer | not null default 0
execute_on | integer | not null default 1
Indexes:
"scripts_pkey" PRIMARY KEY, btree (scriptid)
"scripts_3" UNIQUE, btree (name)
"scripts_1" btree (usrgrpid)
"scripts_2" btree (groupid)
Foreign-key constraints:
"c_scripts_1" FOREIGN KEY (usrgrpid) REFERENCES usrgrp(usrgrpid)
"c_scripts_2" FOREIGN KEY (groupid) REFERENCES groups(groupid)
Referenced by:
TABLE "opcommand" CONSTRAINT "c_opcommand_2" FOREIGN KEY (scriptid) REFERENCES scripts(scriptid)

Comment