According to the documentation of rrd http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html "ds-name is the name you will use to reference this particular data source from an RRD. A ds-name must be 1 to 19 characters long in the characters [a-zA-Z0-9]" therefore ask you to replace the
line.match(/^ds[([a-zA-Z]+)].([a-zA-Z]+)
by
line.match(/^ds[([a-zA-Z0-9]+)].([a-zA-Z0-9_]+)
According to the documentation of rrd http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html "ds-name is the name you will use to reference this particular data source from an RRD. A ds-name must be 1 to 19 characters long in the characters [a-zA-Z0-9]" therefore ask you to replace the line.match(/^ds[([a-zA-Z]+)].([a-zA-Z]+) by line.match(/^ds[([a-zA-Z0-9]+)].([a-zA-Z0-9_]+)