I'm assuming this is being used within SAM. SAM has an expectation of 1 required field, and 1 optional field. The required field is 'Statistic' and the optional is message. You can have up to 10 statistic values, and this is what SAM will use for alerting, and plotting graphs. You probably want to adjust your output to look something like this:
if ($line =~ / uptime([^\n]* /) { print "Message.Uptime: SMS Uptime is $1"; print "Statistic.Uptime: $1"; } if ($line =~ /SMS: received \b([\d]+)[\S ]*sent \b([\d]+) /) { print "Message.smsreceived: SMS Received $1"; print "Statistic.smsreceived: $1"; print "Message.smssent: SMS Sent: $2"; print "Statistic.smssent: $2"; }
I'm sure you can guess from my code what is going on. It's been a while since I've written perl, so I've probably butchered it. But basically they come in pairs, the Message is optional, but it's handy if you want to throw in extra information that you can put in the UI. Statistic is the one SAM is looking for. If you are only interested in outputting a single value, you can just use Statistic with no name tag after it.
You can see a better (unbutchered) version in the documentation here.