Page 1 of 2
servicedisplayname field size 64 characters
Posted: Fri Dec 05, 2014 1:18 pm
by zaji_nms
Dear Expert
We have added display_name (SERVICEDISPLAYNAME) whatever so called and working fine as expected but there is little issue, while configuring the HOST/SERVICE, there big room to enter 100 or more characters, however while get display in NOCSCREEN its showing only 64 characters.
Looks there is variable length 64 characters in database.
Can you please let us know which database, table, field have to increase field length and is it safe to change like that? Is there any bad impact to modify table?
Regards
Re: servicedisplayname field size 64 characters
Posted: Fri Dec 05, 2014 2:48 pm
by tmcdonald
The following command will increase that database field size to 128:
Code: Select all
echo "use nagios; ALTER TABLE nagios_services MODIFY display_name VARCHAR(128);" | mysql -u root -pnagiosxi
http://stackoverflow.com/questions/1279 ... ysql-table
Just make sure the -pnagiosxi has the right password, but it should be the same if you have not modified it. There shouldn't be any huge performance hits by doing this since your display names should all be under 64 at the moment anyway.
Re: servicedisplayname field size 64 characters
Posted: Sat Dec 06, 2014 12:47 pm
by zaji_nms
Dear tmcdonald
I did and found little change before and after
Code: Select all
| Field | Type | Null | Key | Default | Extra |
| display_name | varchar(64) | NO | | | |
| display_name | varchar(128) | YES | | NULL | |
I changed in both tables, nagios_hosts , nagios_services ... result is expected showing full DISPLAYNAME more than 100 characters in Host & Services.
Just please clear my doubt as above , Null Yes, Default NULL , little change, any inverse effect?
Regards
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 10:17 am
by tmcdonald
This will only affect the hosts/services going forward. Previously since the limit was 64, anything longer than that would be cut off and would not become available simply by increasing the column width.
Go to the Core Config Manager and find one of the hosts that needs to have a display name longer than 64 characters, write out the full name, then save and apply config. Then see if the name increases or not in the NOC screen.
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 12:05 pm
by zaji_nms
Dear tmcdonald
I think you read my previous post in hurry....no issue....I will explain again.
As I told, its okay, done good, result is as expected, giving full display name, more than 100 characters.
Plz see the change in field properties. Can you clear my doubt that field property has been changed, before changes, Null was NO , Default was Blank........after the changes field properties changed, NULL=YES, DEFAULT=NULL
(will it effect in future? or there will be no issue)? I want to clarify that.....
Regards
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 12:07 pm
by zaji_nms
or while applying command I should add the properties too.... NULL=NO , Default=Blank (but I don't know how to change in single command what you suggested).
Regards
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 12:17 pm
by tmcdonald
In theory it should not make a difference since we never leave those fields blank anyway, which means they should never get a chance to be null.
However if you want it to match perfectly you can run this:
Code: Select all
echo "use nagios; ALTER TABLE nagios_services MODIFY display_name VARCHAR(128) NOT NULL DEFAULT '';" | mysql -u root -pnagiosxi
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 1:29 pm
by zaji_nms
Dear tmcdonald
Sorry to bother you, when there will be new version (new nagios release, next year), will shrink back this field from 128 to 64?
Regards
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 1:36 pm
by tmcdonald
Looking at the current upgrade script, it does not look like we modify the database in that way, but I cannot say for sure whether this will be the case in the future. However, my guess is this will not be modified as there is not a great reason currently to do so. If anything, it would be increased to accommodate situations like this.
Re: servicedisplayname field size 64 characters
Posted: Mon Dec 08, 2014 2:44 pm
by zaji_nms
Dear tmcdonald
Thanks for your guide.....its done.
FYI, the DISPLAY_NAME is very crucial to us, without it we cannot survive. Recently we did some little changes (ajaxhelpers-servicestatus.inc.php) and able to search on DISPLAY_NAME , we all NMS team delighted. You should incorporate everywhere as a basic field.
Me still missing this DISPLAY_NAME on the Title of MRTG Graph (PNP) , hope you will work on it to incorporate or will guide me how to do.
** PLEASE CLOSE THIS CASE **
Regards