Hi,
We have developed a perl script to monitor the Google Applications stats but my plugin sometimes give an 'malformed JSON string,' when running the script.
[root@clrfmd1 libexec]# ./check_googlestats.pl --service='Google Calendar'
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at ./check_googlestats.pl line 23
The plugin doesn't always throw this error and works pretty fine most of the time.
The URL that we are accessing is below
my $content = `curl http://www.google.com/appsstatus/json/en 2>/dev/null`;
$content =~ s/dashboard.jsonp\(//g;
$content =~ s/\)\;$//g;
The script is trying to process the response from JSON by decoding the URL.
Does anybody have any idea on this? There appears to somehow the parsing is wrong and I am unable to find the problem. Could somebody please let me know what changes are required to get this going.
Regards,
Sricharan
JSON Parsing error
Re: JSON Parsing error
This is less of a Nagios problem and more of a Perl problem in general. You might have better luck asking on the perlmonks.org forum.
Former Nagios employee